security: handle unhandled IndexError exceptions (DoS) in cryptographic classes#1386
security: handle unhandled IndexError exceptions (DoS) in cryptographic classes#1386renich wants to merge 2 commits into
Conversation
Added bounds and length validation in `Amber::Support::MessageVerifier` and `Amber::Support::MessageEncryptor` to prevent unhandled `IndexError` exceptions when processing malformed input. Co-authored-by: renich <225115+renich@users.noreply.github.com>
|
We'll accept this as defense-in-depth hardening — the code change is correct and safe — but the framing needs a correction and it needs tests. ✅ (with changes) What I verified:
Requested changes before merge:
Keeping the |
…dening Add unit specs for MessageVerifier and MessageEncryptor covering malformed, truncated, and undersized payloads. Correct date and severity description in the PR files and agent notes to reflect graceful-rejection hardening instead of a worker DoS crash. Co-developed-by: Gemini AI <renich+gemini@woralelandia.com> Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
|
I have updated the PR to address your feedback. Following your suggestions:
All specs compile and pass. (Note: This contribution was co-developed with Gemini AI. Rénich has directed, reviewed, tested, and takes full responsibility for this code.) |
Checks payload and signature sizes before array slicing and parsing in MessageVerifier and MessageEncryptor, preventing unhandled IndexError DoS vectors.
Co-developed-by: Gemini AI renich+gemini@woralelandia.com
Signed-off-by: Rénich Bon Ćirić renich@woralelandia.com