Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

21-dot-dev/swift-secp256k1
main @ 2668a3a
3
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Command Injection: 1 prior fix. Scrutinize any change in this area.
.github/workflows/update-subtree.yml: most-fixed (1 issue). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Command Injection: Inline interpolation of untrusted workflow inputs directly into GitHub Actions shell execution steps allowed arbitrary shell command execution in the runner context. This was resolved by migrating variables to step-level environment variables.
Memory Safety: An out-of-bounds memory access risk existed during decapsulation when processing ciphertext inputs of unexpected sizes, which could crash the process or leak memory. The fix introduced strict validation of the ciphertext input length prior to calling the underlying BoringSSL C function.
Information Disclosure: Insecure memory clearing in the cryptographic vendor library could lead to lingering secrets in memory. Additionally, failing to invalidate the secnonce during multi-signature signing operations posed a risk of key compromise, addressed by zeroing out the secnonce memory.