Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18e191e7b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function verifySignature(receiptHash, signatureB64, pubkeyBytes) { | ||
| const spki = Buffer.concat([ED25519_SPKI_PREFIX, pubkeyBytes]); | ||
| const key = crypto.createPublicKey({ key: spki, format: "der", type: "spki" }); | ||
| return crypto.verify(null, Buffer.from(receiptHash, "utf8"), key, Buffer.from(signatureB64, "base64")); |
There was a problem hiding this comment.
Reject non-canonical base64 signatures during verification
verifySignature decodes signatureB64 with Buffer.from(..., "base64") but never validates that the input is strict base64, and Node silently ignores trailing invalid characters; as a result, a tampered value like "<validSig>***" is accepted and still verifies as valid. This weakens receipt validation because malformed or manipulated signature encodings are treated as authentic instead of being rejected.
Useful? React with 👍 / 👎.
Codex generated this pull request, but encountered an unexpected error after generation. This is a placeholder PR message.
Codex Task