this post was submitted on 03 Sep 2024
57 points (100.0% liked)

Cybersecurity

5664 readers
108 users here now

c/cybersecurity is a community centered on the cybersecurity and information security profession. You can come here to discuss news, post something interesting, or just chat with others.

THE RULES

Instance Rules

Community Rules

If you ask someone to hack your "friends" socials you're just going to get banned so don't do that.

Learn about hacking

Hack the Box

Try Hack Me

Pico Capture the flag

Other security-related communities !databreaches@lemmy.zip !netsec@lemmy.world !cybersecurity@lemmy.capebreton.social !securitynews@infosec.pub !netsec@links.hackliberty.org !cybersecurity@infosec.pub !pulse_of_truth@infosec.pub

Notable mention to !cybersecuritymemes@lemmy.world

founded 1 year ago
MODERATORS
 

Anyone with basic knowledge of SQL injection could login to this site and add anyone they wanted to KCM and CASS, allowing themselves to both skip security screening and then access the cockpits of commercial airliners.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 0x0@lemmy.dbzer0.com 1 points 2 months ago (1 children)

The beautiful thing about string injection vulnerabilities is that they will never ever stop happening. It's just too easy to sprintf untrusted input.

[โ€“] ravhall@discuss.online 2 points 2 months ago (1 children)

๐Ÿ˜ญ prepare your queries!!!!

[โ€“] 0x0@lemmy.dbzer0.com 3 points 2 months ago

You know, the reason this happens is that you can ask your database to execute a string type, but languages usually don't distinguish between a static string and a dynamically constructed string.

Not to proselytize, but this is a place where rust's lifetime annotations can shine. The DB interface should take a &'static str( and a variable number of parameters to insert) so it can be certain that no untrusted user input has already been injected into the query string. Assuming all static data is trusted, the sql injection vulnerabilities just went poof.

Sadly, it looks like rusqlite's execute() takes a non-static str. I wonder why.