AI coding assistants are not disqualified from firmware work, but a peer-reviewed study found roughly 40% of GitHub Copilot's generated code vulnerable to known weakness classes — the published research says they cannot be trusted without exactly the review process a human contributor's code already gets. GitHub's own current documentation admits its Copilot Autofix feature can suggest fixes that "fail to remediate the underlying vulnerability or introduce new vulnerabilities," and a 2025 academic analysis found large language models hallucinate non-existent package names often enough for attackers to register and poison them — a practice researchers call "slopsquatting."
This guide draws on NIST's own published SSDF profile for generative AI and its Generative AI Profile, GitHub's current Copilot documentation, the peer-reviewed "Asleep at the Keyboard?" study and the USENIX "We Have a Package for You!" study, OWASP's Top 10 for LLM Applications, AWS's own security bulletin and MITRE ATLAS case studies — each fetched and quoted directly for this guide.
Key takeaways
- Not automatically, but the evidence says "assume nothing" is the safer default than "assume it's fine." The clearest data point remains "Asleep at the Keyboard?
- That 40% figure describes one assistant generation, tested once, several years ago — but the underlying problem has not quietly gone away since.
- Six of the ten entries in the OWASP Top 10 for LLM Applications 2025 describe what a coding assistant can do to a firmware codebase.
- Yes, at least twice in ways MITRE now tracks.
Do AI coding assistants actually make firmware code less secure?
Not automatically, but the evidence says "assume nothing" is the safer default than "assume it's fine." The clearest data point remains "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions" (Pearce, Ahmad, Tan, Dolan-Gavitt and Karri, IEEE Symposium on Security and Privacy 2022): across 89 scenarios drawn from MITRE's CWE Top 25 and OWASP's Top 10, Copilot generated 1,689 programs, and the researchers "found approximately 40% to be vulnerable." Firmware and embedded code sit squarely inside that exposure — memory-safety weaknesses from the CWE Top 25 (buffer overflows, out-of-bounds access, use-after-free) are exactly the class of bug C and C++ firmware code is already most prone to, with or without an AI assistant in the loop.
How often does AI-generated code actually contain vulnerabilities?
That 40% figure describes one assistant generation, tested once, several years ago — but the underlying problem has not quietly gone away since. GitHub's own current responsible-use documentation for Copilot Autofix, the feature meant to fix flagged vulnerabilities rather than write new code, states plainly: "The system may suggest fixes that fail to remediate the underlying vulnerability or introduce new vulnerabilities," and separately, "The system may suggest fixes that are syntactically valid but change the semantics of the program. The system has no understanding of the programmer's intent." GitHub's conclusion is the same one a security team should draw: "Developers must evaluate each suggestion and verify it maintains the codebase's intended behavior." That is GitHub itself, in 2026-current documentation, describing its newest AI fix-suggestion feature in almost the same terms the 2022 academic study used for raw code generation.
Which OWASP LLM Top 10 risks apply to a coding assistant in a firmware repo?
Six of the ten entries in the OWASP Top 10 for LLM Applications 2025 describe what a coding assistant can do to a firmware codebase. Our OWASP LLM Top 10 guide covers all ten; the firmware reading is:
| OWASP entry | How it shows up with a coding assistant | Firmware example |
|---|---|---|
| LLM01:2025 Prompt Injection | Instructions hidden in a rules file, issue, README or tool output steer what the assistant writes or runs | A vendored SDK's README tells the agent to disable a bounds check |
| LLM02:2025 Sensitive Information Disclosure | Repository content sent to the model, or echoed into suggestions | Signing keys, provisioning secrets or factory test credentials in the tree |
| LLM03:2025 Supply Chain | Compromised models, plugins, extensions or packages | A poisoned IDE extension or a squatted package name |
| LLM05:2025 Improper Output Handling | Generated output passed to a shell or build step unchecked | An agent runs a suggested flashing script as root |
| LLM06:2025 Excessive Agency | OWASP names its root causes as "excessive functionality; excessive permissions; excessive autonomy" | An agent with push rights and production signing access |
| LLM09:2025 Misinformation | The LLM09 entry lists "Unsafe Code Generation": the model "suggests insecure or non-existent code libraries" | A plausible but wrong register offset or an invented HAL helper |
OWASP's LLM06 mitigation advice applies directly to agents: "Utilise human-in-the-loop control to require a human to approve high-impact actions before they are taken."
What is "slopsquatting," and why does it matter for firmware's dependency chain?
Slopsquatting is a supply-chain attack built directly on AI hallucination: an attacker registers a package name that coding models are known to invent, so that whatever pulls in "the package the AI suggested" — a developer copy-pasting an import line, or an autonomous coding agent running unattended — gets the attacker's package instead of an error. The scale is documented, not speculative. "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs" (Spracklen, Wijewickrama, Sakib, Maiti, Viswanath and Jadliwala, USENIX Security 2025) tested 16 coding models and reported that "all 16 tested coding models exhibited notable rates of package hallucinations, averaging 19.6% across the board" — commercial models fared better, around 5%, against roughly 21% for open-source models — and recorded "205,474 unique non-existent packages" invented across their test runs. Firmware teams carry extra exposure here: vendor SDK and chip-maker package registries typically have far less namespace enforcement than npm or PyPI, so a plausible-sounding hallucinated driver or RTOS helper library name is exactly the kind of gap an attacker can fill. OWASP's Top 10 for LLM Applications names the broader category directly as LLM03:2025 "Supply Chain", pointing to real incidents in the same family — attackers who "tricked model developers into downloading a compromised PyTorch dependency with malware," and the "Shadow Ray attack on the Ray AI framework," where, per OWASP, "five vulnerabilities are believed to have been exploited in the wild affecting many servers." Our package URL (purl) guide covers the identifier discipline — exact ecosystem, name and version, not a bare string an assistant typed — that makes a dependency verifiable in the first place.
Has a coding assistant itself become the attack path?
Yes, at least twice in ways MITRE now tracks. The MITRE ATLAS case study AML.CS0047 records an incident in the Amazon Q Developer extension for VS Code. Per AWS security bulletin AWS-2025-015, the extension "had an inappropriately scoped GitHub token in their CodeBuild configuration," which let a threat actor "commit malicious code into the extension's open-source repository that was automatically included in a release" — version 1.84.0 (CVE-2025-8217). AWS states the code "was unsuccessful in executing due to a syntax error"; ATLAS quotes the injected prompt, which told the agent to "clean a system to near-factory state and delete file-system and cloud resources." AWS replaced it with 1.85.0 and asked customers to remove 1.84.0, "including any forked or derivative copies."
The second, AML.CS0041 (an exercise), is the "Rules File Backdoor": Pillar Security researchers showed that invisible Unicode characters in the rules files that configure Cursor and GitHub Copilot can hide instructions that make the assistant insert backdoors into generated code. GitHub's response, per its 1 May 2025 changelog, was a warning on github.com when a file contains hidden Unicode text, which "can cause code to appear one way and be interpreted another way, especially by AI." For a firmware team, both cases mean the assistant, its extension and its configuration files belong in the same supply-chain review as the compiler and the SDK.
What does NIST's official guidance actually require for AI-assisted development?
NIST SP 800-218A, "Secure Software Development Practices for Generative AI and Dual-Use Foundation Models: An SSDF Community Profile" (July 2024), refuses to grant AI-generated code any special exemption: "Practices and tasks in this Profile do not distinguish between human-written and AI-generated source code, because it is assumed that all source code should be evaluated for vulnerabilities and other issues before use." Where it does add something specific, it raises the bar rather than lowering it: its risk-modeling practice instructs teams to "incorporate relevant AI model-specific vulnerability and threat types in risk modeling," explicitly listing "poisoning of training data, malicious code or other unwanted content in inputs and outputs, denial-of-service conditions arising from adversarial prompts, supply chain attacks, unauthorized information disclosure, theft of AI model weights, and misconfiguration of data pipelines" as categories a firmware team's threat model should now cover, alongside the classic ones. Our guide to the related NIST SSDF (SP 800-218) covers the base framework this Profile extends for generative-AI and foundation-model use specifically.
NIST's companion AI 600-1 Generative AI Profile (July 2024) lists 12 risks, and four of them read like a coding-assistant risk register. Confabulation is "the production of confidently stated but erroneous or false content." Human-AI Configuration covers "automation bias, over-reliance" — a reviewer approving a patch because it looks fluent. Information Security includes an "increased attack surface for targeted cyberattacks, which may compromise a system's availability or the confidentiality or integrity of training data, code, or model weights." Value Chain and Component Integration covers "non-transparent or untraceable integration of upstream third-party components." Our NIST AI 600-1 guide walks through the full list.
Which assistant settings should a firmware team change first?
Most of the controls above are settings in the tool rather than new process. Using GitHub Copilot as the documented example:
| Setting | What the vendor documents | Firmware use |
|---|---|---|
| Content exclusion | GitHub Docs: repository, organization and enterprise rules; changes "can take up to 30 minutes to take effect" in already-loaded IDEs; "not a substitute for operating-system permissions or other access controls" | Exclude key stores, provisioning scripts, factory configuration and secure-boot material — and keep them out of the developer checkout anyway |
| Agent environment | Per the Copilot cloud agent docs, cloud sandboxes "honor repository and organization firewall allowlists" | Allow only your package mirror and SDK host, so a hallucinated name cannot resolve on the open internet |
| Review gate | Session logs "do not replace your own review and testing" | Branch protection: no agent-authored change merges without a human approval and passing tests |
| Hidden text | Warning on hidden Unicode (May 2025) | Add a CI check that fails on bidirectional or tag characters in source and rules files |
| Extension versions | AWS asked for 1.84.0 removal, "including any forked or derivative copies" | Pin and inventory IDE extensions on build and developer machines |
Worked example: how should a reviewer check an AI-written parser fix?
Synthetic example. The board, code and findings are invented to show the method.
A static-analysis tool flags an out-of-bounds read in the UART command parser of a made-up environmental-sensor board. A developer accepts an assistant's suggested fix, which adds a length check and a new include for a "ringbuf_safe" helper library.
Check that the fix fixes the reported bugThe new check compares against the buffer size in bytes, but the loop indexes 16-bit words — the read is still out of bounds for odd lengths. This is the failure GitHub's Autofix documentation describes: syntactically valid, semantically wrong. Check what else changedThe suggestion also removed a volatilequalifier on a register-mapped status variable. The build passes; the hardware behaviour changes.Check every new dependency"ringbuf_safe" does not exist in the SDK or the internal mirror. That is the slopsquatting pattern; the include is removed, not "installed." Re-run the original finding and the tests, plus a fuzz pass on the parser with odd-length and maximum-length frames. Record provenanceThe pull request is labelled as AI-assisted so later reviewers and the PSIRT know how the code arrived, consistent with SP 800-218A's rule that AI-generated and human-written code get the same scrutiny. Check the shipped imageAfter release, the firmware SBOM is regenerated from the binary to confirm no unexpected component entered the build.
What should a firmware team actually do about this today?
Review AI-authored code like a new contributor's pull request, not a trusted teammate'sNIST SP 800-218A's own position — no distinction between human-written and AI-generated source — is the simplest rule to enforce: the same static analysis, code review and test suite, every time, no AI fast lane. Pin every dependency to an exact version and hash, never a bare package name an assistant suggested, so a hallucinated or squatted name cannot silently resolve to something new on a future build. Audit AI-suggested *fixes* with the same scrutiny as AI-suggested *new* codeGitHub's own documentation for Copilot Autofix carries the identical caveat the 2022 Copilot generation study did — a suggested fix that compiles is not the same as a fix that is correct. Keep an SBOM built from what the firmware binary actually contains, not only from a build manifest, since a manifest reflects what was requested, not what ended up in the image — the only way to catch a dependency that entered through a hallucinated or compromised path after the fact. Extend the firmware threat model to the categories NIST SP 800-218A names for generative AI use— training-data poisoning, adversarial-prompt-driven denial of service, and AI supply-chain attacks — rather than treating "AI risk" as covered by ordinary code review alone.
What are the common pitfalls?
- Trusting the green build. Compiling and passing unit tests says nothing about semantics on real hardware.
- Giving agents the release keys. Excessive Agency starts with an agent that can sign or push to a release branch.
- Relying on content exclusion as access control. GitHub states it is not one.
- Ignoring the tooling supply chain. The Amazon Q incident came through the assistant's own extension release.
- Reviewing rules files as documentation. They are executable instructions to the model; review them like code.
Because SoftWSP's device firmware security scan builds its SBOM straight from the compiled binary image rather than trusting a declared build manifest, a dependency that entered a firmware build because an assistant suggested — or hallucinated — a package name is identified the same way any other component is: by what the binary actually contains, matched against known vulnerabilities, not by what a manifest claims was intended. See firmware SBOM for how that component-identification process works when there is no source code to start from.
This guide is general technical information based on the sources cited above, not a substitute for NIST SP 800-218A, your AI coding assistant vendor's current documentation, or your own organization's secure development policy.
Put this guide to work
Frequently asked questions
What security risks do AI coding assistants actually introduce into firmware development?
Three distinct, separately documented risks, not one. First, the code an assistant originally generates can itself be insecure: a peer-reviewed study of GitHub Copilot found roughly 40% of generated programs vulnerable across scenarios drawn from MITRE's CWE Top 25. Second, even when an assistant is asked to *fix* a known vulnerability rather than write new code, GitHub's own current documentation warns that "the system may suggest fixes that fail to remediate the underlying vulnerability or introduce new vulnerabilities" and that it "has no understanding of the programmer's intent." Third, assistants can hallucinate dependencies that do not exist — a 2025 academic study found large language models invent non-existent package names at an average rate of 19.6%, and an attacker who registers one of those names under a firmware SDK's package manager gets a dependency pulled straight into a build. Firmware code carries extra exposure on all three: C/C++ memory-safety classes dominate the CWE Top 25 Copilot study, and vendor SDK package registries typically have far less namespace policing than npm or PyPI.
How often does AI-generated code actually contain vulnerabilities, and what kind?
In "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions" (Pearce, Ahmad, Tan, Dolan-Gavitt and Karri, IEEE Symposium on Security and Privacy 2022), researchers prompted Copilot across 89 scenarios drawn from MITRE's CWE Top 25 and OWASP's Top 10, producing 1,689 generated programs. Their finding, stated in their own abstract: "we found approximately 40% to be vulnerable." That study is now several years old and covers one specific assistant generation; GitHub's own current responsible-use documentation for its newer Copilot Autofix feature still carries the same caveat today, stating a suggested fix "may suggest fixes that are syntactically valid but change the semantics of the program" and that "developers must evaluate each suggestion and verify it maintains the codebase's intended behavior" — the underlying unreliability has not been declared solved, it has been handed back to the reviewer.
What is "slopsquatting," and why does it matter for a firmware dependency chain?
Slopsquatting is the practice of registering a package name that large language models are known to hallucinate, so that a developer — or an autonomous coding agent — who blindly installs what the AI suggested pulls down the attacker's malicious package instead of an error. The scale is not theoretical: "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs" (Spracklen, Wijewickrama, Sakib, Maiti, Viswanath and Jadliwala, USENIX Security 2025) tested 16 coding models and found "all 16 tested coding models exhibited notable rates of package hallucinations, averaging 19.6% across the board," with commercial models averaging around 5% against roughly 21% for open-source models, and recorded "205,474 unique non-existent packages" generated across their test runs. OWASP's own Top 10 for LLM Applications names the adjacent risk category directly: LLM03:2025 "Supply Chain" cites real incidents including attackers who "tricked model developers into downloading a compromised PyTorch dependency with malware" and the "Shadow Ray attack on the Ray AI framework," where OWASP states "five vulnerabilities are believed to have been exploited in the wild affecting many servers."
What does NIST's official guidance actually say about securing AI-assisted software development?
NIST SP 800-218A, "Secure Software Development Practices for Generative AI and Dual-Use Foundation Models: An SSDF Community Profile" (July 2024), is explicit that AI-generated code gets no pass: "Practices and tasks in this Profile do not distinguish between human-written and AI-generated source code, because it is assumed that all source code should be evaluated for vulnerabilities and other issues before use." Its risk-modeling practice (PW.1.1, enhanced to a "High" priority task for generative-AI use) instructs teams to "incorporate relevant AI model-specific vulnerability and threat types in risk modeling," explicitly naming "poisoning of training data, malicious code or other unwanted content in inputs and outputs, denial-of-service conditions arising from adversarial prompts, supply chain attacks, unauthorized information disclosure, theft of AI model weights, and misconfiguration of data pipelines" as the categories to cover — a list that reaches well past "does the suggested code compile."
What should a firmware team actually do about AI coding assistants today?
Treat every AI-authored or AI-modified line the same as a new contributor's pull request: it goes through the same static analysis, code review and test suite before merge, with no fast lane because a human didn't type it — directly consistent with NIST SP 800-218A's refusal to distinguish AI-generated from human-written code. Pin firmware dependencies to an exact version and hash rather than a bare package name an assistant suggested, so a hallucinated or squatted package name cannot silently resolve to something new. Keep a current software bill of materials built from what actually ships, not from a build manifest alone, since a manifest reflects what was *requested*, not what a binary actually contains. And budget review time specifically for AI-suggested dependency additions and AI-suggested "fixes" to existing vulnerabilities — both are exactly the two places the research above found the most AI-introduced risk concentrated.
Sources
- NIST SP 800-218A: Secure Software Development Practices for Generative AI and Dual-Use Foundation Models — An SSDF Community Profile (July 2024, PDF)
- GitHub Docs: Responsible use of GitHub Copilot Autofix for code scanning (security and quality AI features)
- Pearce, Ahmad, Tan, Dolan-Gavitt, Karri: "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions," IEEE S&P 2022 (arXiv preprint)
- Spracklen, Wijewickrama, Sakib, Maiti, Viswanath, Jadliwala: "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs," USENIX Security 2025
- OWASP Gen AI Security Project: Top 10 for LLM Applications 2025 — LLM03:2025 Supply Chain
- OWASP Gen AI Security Project: Top 10 for LLM Applications 2025 (list)
- OWASP Gen AI Security Project: LLM09:2025 Misinformation (Unsafe Code Generation)
- OWASP Gen AI Security Project: LLM06:2025 Excessive Agency
- NIST AI 600-1: Artificial Intelligence Risk Management Framework — Generative Artificial Intelligence Profile (July 2024, PDF)
- AWS Security Bulletin AWS-2025-015: Security Update for Amazon Q Developer Extension for Visual Studio Code (Version 1.84)
- CVE.org: CVE-2025-8217 (Amazon Q Developer VS Code extension 1.84.0)
- GitHub Changelog: GitHub now provides a warning about hidden Unicode text (1 May 2025)
- GitHub Docs: Excluding content from GitHub Copilot
- GitHub Docs: GitHub Copilot on GitHub.com and GitHub Mobile (cloud agent environments, firewall allowlists, session logs)
- MITRE ATLAS Data — release file ATLAS-2026.10.yaml (case studies AML.CS0022, AML.CS0041, AML.CS0047)
About this guide
SoftWSP Firmware Security Desk
Covers the Firmware vulnerabilities & fixes cluster: 135 guides.

In this cluster
Questions about this page?
