AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Indexing infrastructure

Decrypt encrypted payment ids per account (#309)

Public commit record

What the developer wrote

Authored by DHIVAKAR R

86/100 · Strong
Decrypt encrypted payment ids per account (#309)

* Decrypt encrypted payment ids per account

ownership_test decrypted a short payment id once per transaction, with
the derivation of the first matching account, and then stored that value
for every account in the transaction. When the sender and the receiver
are both registered, which account comes first decides the receiver's
payment id: if the sender's change output is scanned first, the receiver
gets the sender's (meaningless) decryption. construct_tx adds a dummy
encrypted payment id to most two-output transactions, so this affects
most transfers between accounts on the same server, and tx-confirmation
webhooks filtered on a payment id can miss the payment.

The decrypted value also leaked into spend records of later accounts,
which should only carry unencrypted payment ids.

Each account now starts from the unencrypted payment id and decrypts its
own copy.

Fixes #279

* Move ownership_test unit test to tests/unit/util

The util test library becomes an OBJECT library, like the db one, so
the test case in it is linked into monero-lws-unit.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This fix corrects a bookkeeping bug in Monero's lightweight wallet server. When two accounts on the same server sent money to each other, the server could store the wrong payment ID for the receiver. It also accidentally put decrypted payment IDs into spend records where they did not belong. The patch makes each account decrypt its own payment ID independently, so the right value is recorded every time.

Recommended action

Deploy this patch to any monero-lws instance. Verify that tx-confirmation webhooks filtered by payment ID now fire correctly for transfers between accounts hosted on the same server. Run the new ownership_test unit test to confirm the fix.

Security signals we found

01

Incorrect cryptographic result reused across accounts

02

Payment ID cross-contamination between sender and receiver outputs

03

Sensitive decrypted value stored in wrong database record type

04

Behavior depends on account scan order

05

Webhook/notification logic may miss expected payments

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 10/25
Stealth signal 12/15
Affected reach 10/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.