AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 27 Bitcoin

fuzz: fix ChaCha20 encrypt_single_block to preserve data

Public commit record

What the developer wrote

Authored by Joost Jager

83/100 · Strong
fuzz: fix ChaCha20 encrypt_single_block to preserve data

The fuzzing ChaCha20 implementation's encrypt_single_block was not
copying src to dest, causing encrypted data to be lost (dest remained
zeros). This broke payment flows where metadata is encrypted into
payment_secret - the receiver would decrypt zeros and detect the wrong
payment method (LdkPaymentHash instead of UserPaymentHash), causing
payments to fail with "mismatching preimage".

Fix by making encrypt_single_block copy src to dest (identity
encryption), matching the behavior of the process() method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in a fuzzing-only (test-only) fake version of the ChaCha20 encryption code. The fake encryptor accidentally left the output as all zeros instead of copying the input, which caused simulated Lightning payments to fail during testing. The fix makes the test fake copy input to output unchanged. This is not a real cryptographic vulnerability and does not affect production code.

Recommended action

No production action required. Ensure fuzz tests are re-run to confirm payment flows now pass. Consider adding a regression test that verifies encrypt_single_block preserves input data in fuzz builds.

Security signals we found

01

Test-only fuzz stub bug, not production crypto

02

Incorrect output buffer handling in encryption helper

03

Payment flow failure in fuzz tests due to metadata corruption

04

No real confidentiality/integrity bypass

Risk score

Why this scored 27/100

Our methodology →
Potential impact 8/30
Exploitability 0/25
Stealth signal 2/15
Affected reach 3/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.