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

java: fix output type for psbt_get_output_amount

Public commit record

What the developer wrote

Authored by Jon Griffiths

60/100 · Adequate
java: fix output type for psbt_get_output_amount

Reported-by: Efstratios Kaplanellis (@5tratan) of Almamater Technologies
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes a Java language binding bug where a function that reads a Bitcoin transaction output amount was incorrectly declared to return a 'size' type (a memory/length value) instead of an unsigned 64-bit integer. Output amounts in Bitcoin are 64-bit integers, so the wrong return type could cause the returned value to be truncated, misinterpreted, or trigger type-conversion errors in Java applications using libwally-core. The fix is a one-line change in the SWIG interface file used to generate Java wrappers.

Recommended action

Review other %returns_size_t declarations in the SWIG interface to ensure monetary or uint64_t values are not similarly mis-typed, and add tests that verify large output amounts round-trip correctly through the Java bindings.

Security signals we found

01

Incorrect JNI/SWIG return type for cryptographic/monetary value

02

Potential integer truncation of PSBT output amount

03

Type confusion between size_t and uint64_t in language bindings

Risk score

Why this scored 36/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 6/15
Affected reach 5/15
Confidence 7/10
Evidence quality 3/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.