Third-party crypto libs pinned to audited versions
Why it matters
CWE-1357 (reliance on insufficiently trustworthy component) applies directly to floating version constraints on cryptographic libraries: crypto-js@^4.1.0 will silently upgrade to a version containing vulnerabilities or breaking changes during a routine npm install. PCI-DSS 4.0 Req-6.3 requires that security vulnerabilities in all system components be identified and protected — floating deps undermine this by allowing unvetted code into the cryptographic layer without a code review or security audit. SLSA L2 and SSDF PW.4 both require pinned, audited dependencies for supply chain integrity. A compromised crypto library release — even for 24 hours before detection — can backdoor encryption for all data processed during that window.
Severity rationale
Info because floating crypto library versions introduce supply chain risk that only manifests during an actual compromised package release, but the control gap is a compliance finding under PCI-DSS Req-6.3.
Remediation
Pin all cryptographic library versions to exact semver in package.json and run npm audit as part of CI:
{
"dependencies": {
"jose": "5.2.4",
"bcrypt": "5.1.1",
"argon2": "0.31.2"
}
}
Add a CI step that fails on moderate+ vulnerabilities:
# .github/workflows/security.yml
- name: Audit crypto dependencies
run: npm audit --audit-level=moderate --production
Document each pinned version in docs/crypto-lib-audit.md with the audit date and the reviewer — this is the audit trail PCI-DSS Req-6.3 requires:
| Library | Version | Audited | By | Notes |
|----------|---------|------------|-------------|---------------------------|
| jose | 5.2.4 | 2026-03-15 | J. Smith | No CVEs, maintained |
| argon2 | 0.31.2 | 2026-03-15 | J. Smith | Native binding, verified |
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Financial Data Encryption Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1357 — Reliance on Insufficiently Trustworthy Component
- pci-dss:4.0 · Req 6.3 — Security vulnerabilities are identified and protected
- slsa:1.0 · L2 — SLSA Build L2 — Hosted build platform with provenance
- ssdf:800-218 · PW.4 — SSDF PW.4 — Reuse existing, well-secured software where feasible
Taxons
History
- 2026-04-18·v1.0.0·Initial import from finserv-encryption·automated