Skip to content

SDK L2PS — defensive decryptTx content binding #924

@linear

Description

@linear

What

When the L2PS SDK decrypts an inner transaction, it compares the original hash carried in the encrypted payload to the decrypted transaction's own .hash field — but does not recompute that hash from the decrypted content. A caller that trusts the SDK alone, without going through a node, would accept a tampered inner transaction as long as its .hash field still matches the payload's original_hash.

Why this matters — and why it is low priority

The node already independently re-verifies every inner transaction via confirmTx/isCoherent before accepting it, so this is not an exploitable bypass on any production path. Adding the SDK-side recomputation is defence-in-depth — it closes the gap for any future caller that does not have a node in front of it (offline tooling, audit consumers).

Fix

Recompute the decrypted content's hash through the SDK's serializeTransactionContent (both fork shapes), compare to the carried original_hash, and verify the inner signature per algorithm. Surface a clear error on mismatch instead of returning the tampered transaction.

Source

PATH-OS L2PS hardening report — they down-corrected this from "auth bypass" to "defence-in-depth" after reading the node source. Patch is ready to submit if we want it.

Status

Todo. Low priority — not on the path of any production traffic today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions