Skip to content

Commit b12b19a

Browse files
Merge pull request #188 from ossf/ai_writing_code
Note issues when AI is writing code, including slopsquatting
2 parents 1be93f4 + 9d8cf09 commit b12b19a

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

secure_software_development_fundamentals.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5449,10 +5449,34 @@ Machine learning (ML) is a field of inquiry devoted to
54495449
understanding and building methods that 'learn', that is,
54505450
methods that leverage data to improve performance on some set of tasks
54515451
(*Machine Learning*, Tom Mitchell).
5452-
ML is often considered a subset of AI.
5453-
A significant amount of AI security work today focuses on ML;
5452+
ML is often considered a subset of AI, and ML includes the use of
5453+
Large Language Models (LLMs).
5454+
A significant amount of AI security work today focuses on ML and LLMs;
54545455
we will take the same focus here.
54555456

5457+
First, let's discuss using AI systems to help write code.
5458+
It's *vital* to *not* blindly trust AI systems to write code.
5459+
Instead, when using them actively engage with the tools, rephrase questions,
5460+
and carefully check their results.
5461+
This is because AI-generated code often contains vulnerabilities.
5462+
This should be expected; such systems are typically trained on
5463+
code with vulnerabilities and they don't understand their context of use.
5464+
One study found that participants using an AI assistant wrote significantly
5465+
less secure code, but were more likely to believe their code was secure
5466+
[Perry2022](https://arxiv.org/abs/2211.03622).
5467+
Another found 35.8% of code snippets contained vulnerabilities
5468+
[Fu2023](https://arxiv.org/abs/2310.02059).
5469+
AI-generated code will probably get better over time,
5470+
but perfection is unlikely.
5471+
Even worse, LLM systems often hallucinate package names that don't exist.
5472+
Attackers sometimes perform *slopsquatting* attacks, that is,
5473+
attackers create malicious packages with those LLM-hallucinated fake names
5474+
as a dangerous trap for the unwary
5475+
[Gooding2025](https://socket.dev/blog/slopsquatting-how-ai-hallucinations-are-fueling-a-new-class-of-supply-chain-attacks).
5476+
Again, don't blindly trust AI systems to write code; take steps such as
5477+
carefully checking their results.
5478+
5479+
Now let's discuss how to build more secure software systems that *use* ML.
54565480
Building ML systems often involve several processes, namely
54575481
training, testing, and inference. Inference is when the ML system is being
54585482
used by its users.
@@ -6435,6 +6459,8 @@ Forum of Incident Response and Security Teams (FIRST), *Traffic Light Protocol (
64356459

64366460
Friedl, Jeffrey E.F., *Mastering Regular Expressions*, 3rd Edition, O’Reilly Media, ISBN 9780596528126, 2006-08 ([https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/](https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/))
64376461

6462+
Fu, et al, 2023, “Security Weaknesses of Copilot Generated Code in GitHub”, <https://arxiv.org/abs/2310.02059>
6463+
64386464
Garavel, Hubert, et al, *Formal Methods for Safe and Secure Computers Systems*, BSI Study 875, 2013 ([https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/Studien/formal_methods_study_875/formal_methods_study_875.pdf?&#95;&#95;blob=publicationFile&v=1](https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/Studien/formal_methods_study_875/formal_methods_study_875.pdf?&#95;&#95;blob=publicationFile&v=1))
64396465

64406466
Georgiev, Martin; Iyengar, Subodh; Jana, Suman; Anubhai, Rishita; Boneh, Dan; Shmatikov, Vitaly; *The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software*, 2012 ([https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf](https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf))
@@ -6451,6 +6477,8 @@ Goodin, Dan, 2022-08-02, "Post-quantum encryption contender is taken out by sing
64516477

64526478
Gooding, Dan, *Plundering of crypto keys from ultrasecure SGX sends Intel scrambling again*, Ars Technica, 2020-06-09 ([https://arstechnica.com/information-technology/2020/06/new-exploits-plunder-crypto-keys-and-more-from-intels-ultrasecure-sgx/](https://arstechnica.com/information-technology/2020/06/new-exploits-plunder-crypto-keys-and-more-from-intels-ultrasecure-sgx/))
64536479

6480+
Gooding, Sarah, 2025-04-08, "The Rise of Slopsquatting: How AI Hallucinations Are Fueling a New Class of Supply Chain Attacks", <https://socket.dev/blog/slopsquatting-how-ai-hallucinations-are-fueling-a-new-class-of-supply-chain-attacks>
6481+
64546482
Google, OSS-Fuzz project ([https://github.com/google/oss-fuzz](https://github.com/google/oss-fuzz))
64556483

64566484
Greenwald, Glenn, *Why privacy matters*, 2014 ([https://www.ted.com/talks/glenn_greenwald_why_privacy_matters](https://www.ted.com/talks/glenn_greenwald_why_privacy_matters) or [https://www.youtube.com/watch?v=pcSlowAhvUk](https://www.youtube.com/watch?v=pcSlowAhvUk))
@@ -6560,6 +6588,8 @@ Qualys, *SSL Server Test* ([https://www.ssllabs.com/ssltest/](https://www.ssllab
65606588

65616589
Patchstack, 2022, State Of WordPress Security In 2021 ([https://patchstack.com/whitepaper/the-state-of-wordpress-security-in-2021/]( https://patchstack.com/whitepaper/the-state-of-wordpress-security-in-2021/))
65626590

6591+
Perry, Neil, et al, 2022, “Do Users Write More Insecure Code with AI Assistants?”, <https://arxiv.org/abs/2211.03622>
6592+
65636593
Petro, Dan and Allan Cecil, 2021, You're Doing IoT RNG, DEF CON 29 ([https://labs.bishopfox.com/tech-blog/youre-doing-iot-rng](https://labs.bishopfox.com/tech-blog/youre-doing-iot-rng)) with presentation at [https://www.youtube.com/watch?v=Zuqw0-jZh9Y](https://www.youtube.com/watch?v=Zuqw0-jZh9Y)
65646594

65656595
Phil, 2016-04-19, "Detecting the use of "curl | bash" server side", idontplaydarts.com, <https://web.archive.org/web/20230325190353/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/> <!-- https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/ -->

0 commit comments

Comments
 (0)