Skip to content

fix: Out-of-bounds read on zero-length int8 EIP-712 fields during display formatting#980

Merged
apaillier-ledger merged 1 commit into
LedgerHQ:developfrom
Donjon-Cerberus:security/merlin-0b39707
Apr 9, 2026
Merged

fix: Out-of-bounds read on zero-length int8 EIP-712 fields during display formatting#980
apaillier-ledger merged 1 commit into
LedgerHQ:developfrom
Donjon-Cerberus:security/merlin-0b39707

Conversation

@Donjon-Cerberus
Copy link
Copy Markdown
Contributor

Summary

Automated security fix for Out-of-bounds read on zero-length int8 EIP-712 fields during display formatting (High).

CWE: CWE-CWE-125
OWASP: A03:2021-Injection
Fix Confidence: high

What Changed

Added strict length validation for signed integer display formatting in ui_712_format_int(). Zero-length signed integers are now rejected before any formatting work, and the int8 branch now requires exactly one byte before dereferencing data[0], eliminating the out-of-bounds read.

Caveats

  • This fix hardens the UI formatting path directly; it does not add an earlier rejection in field_hash.c, though malformed zero-length signed integers are now rejected before any display formatting occurs.

Verification Checklist

  • Review the code change
  • Run tests to verify no regression
  • Verify the vulnerability is addressed — already verified by Cerberus Sentinel

Created by Cerberus Merlin

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.02%. Comparing base (d0275cf) to head (f8420a9).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #980   +/-   ##
========================================
  Coverage    55.02%   55.02%           
========================================
  Files           16       16           
  Lines         1592     1592           
  Branches       198      201    +3     
========================================
  Hits           876      876           
- Misses         680      712   +32     
+ Partials        36        4   -32     
Flag Coverage Δ
unittests 55.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@apaillier-ledger apaillier-ledger force-pushed the security/merlin-0b39707 branch from 0104e66 to f8420a9 Compare April 9, 2026 14:13
@apaillier-ledger apaillier-ledger merged commit 18e7045 into LedgerHQ:develop Apr 9, 2026
225 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants