Skip to content

Improve BER handling of integer boundaries - #5063

Open
gpotter2 wants to merge 2 commits into
secdev:masterfrom
gpotter2:ber-fixpow
Open

Improve BER handling of integer boundaries#5063
gpotter2 wants to merge 2 commits into
secdev:masterfrom
gpotter2:ber-fixpow

Conversation

@gpotter2

@gpotter2 gpotter2 commented Jul 29, 2026

Copy link
Copy Markdown
Member
  • BER maximum numeric values should be capped at 2**32 when decoding BER_num_dec
  • BER shouldn't allow infinite SEQUENCE nesting, let's limit it to.. uh.. 32

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.51%. Comparing base (5967449) to head (175733c).

Files with missing lines Patch % Lines
scapy/asn1/ber.py 78.57% 3 Missing ⚠️
scapy/asn1/asn1.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5063      +/-   ##
==========================================
+ Coverage   80.49%   80.51%   +0.01%     
==========================================
  Files         390      390              
  Lines       96758    96765       +7     
==========================================
+ Hits        77886    77908      +22     
+ Misses      18872    18857      -15     
Files with missing lines Coverage Δ
scapy/cbor/cbor.py 83.62% <100.00%> (ø)
scapy/cbor/cborcodec.py 87.77% <100.00%> (ø)
scapy/asn1/asn1.py 86.63% <50.00%> (ø)
scapy/asn1/ber.py 86.11% <78.57%> (+3.39%) ⬆️

... and 6 files with indirect coverage changes

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

@gpotter2 gpotter2 changed the title Add max_pow to cap BER decode Improve BER handling of integer boundaries Jul 29, 2026
@gpotter2
gpotter2 force-pushed the ber-fixpow branch 2 times, most recently from 355edd4 to 175733c Compare July 29, 2026 23:18
@gpotter2 gpotter2 added ci/bsd Start *BSD unit tests cleanup Performs some code clean-up and removed ci/bsd Start *BSD unit tests labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Performs some code clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant