The gap between training and shipping
Every model has a training cutoff, and the bulk of its training data is older still, because popular code accumulates over years. When a model writes a version number, it's recalling what was common in that data. It can't know that a CVE was published last month or that a package was abandoned last year.
1. Pinned versions with known CVEs
Here's a typical answer to "give me a requirements.txt for a Django API with JWT auth":
Django==3.2 # end of life since April 2024, no more security fixes djangorestframework==3.12.4 PyJWT==1.7.1 # CVE-2022-29217: algorithm confusion, fixed in 2.4.0 requests==2.25.1 # CVE-2023-32681: leaks Proxy-Authorization, fixed in 2.31.0
Every one of these versions was a sensible choice at some point, and each was common in public code for a long time. That's exactly why the model reaches for them. Pinning makes it worse, because a pinned version never moves unless someone moves it.
2. Packages nobody maintains anymore
Some packages were popular for years and then stopped. Models still recommend them because the old code using them is everywhere:
pycrypto: last release in 2013, with a known heap overflow (CVE-2013-7459). The maintained replacement ispycryptodome, orcryptographyfor most needs.request(npm): deprecated in 2020. It still works, but it won't get fixes when the next issue lands.
An abandoned package isn't vulnerable today by definition. It's a package where the next vulnerability won't be fixed.
3. APIs that were deprecated or removed
The same applies to standard library calls. A classic from years of Node.js tutorials:
const cipher = crypto.createCipher("aes-256-cbc", password); // no IV, key derived with a single MD5 round: identical plaintexts // produce identical ciphertexts, and weak passwords fall to brute force. // Deprecated for years and removed in Node.js 22.
If you're lucky, a removed API fails loudly at runtime. If you're on an older runtime, it works fine and quietly gives you weak encryption. The same goes for MD5 or SHA-1 password hashing, Math.random() for tokens, and other advice that was normal a decade ago.
The fix (Node.js): crypto.createCipheriv("aes-256-gcm", key, iv) with a random 12-byte IV and a key from scrypt or a KMS, or just use a library like libsodium that picks safe defaults for you.
How to catch it
- Run SCA on the pull request, not just on main. The moment an assistant writes a manifest, the versions in it should be checked against CVE, GHSA and OSV data before anyone merges.
- Flag end-of-life and abandoned packages, not only CVEs. A framework past end of life is a vulnerability that just hasn't been published yet.
- Use SAST rules for deprecated crypto APIs.
createCipher, MD5 for passwords and non-cryptographic randomness for secrets are all easy to detect. - Ask for "latest stable" and then verify. Telling the assistant to use current versions helps a bit. The model still can't see versions published after its cutoff.
AquilaX SCA resolves the full dependency tree, including transitive packages, and suggests the lowest version that fixes each issue, so the upgrade is as small as possible.
Check what the AI pinned
AquilaX SCA scans every manifest in every pull request for CVEs, end-of-life versions and malicious packages.
See SCA scanning →