Skip to content

Dcerpc fraglen/v5#14733

Closed
inashivb wants to merge 3 commits intoOISF:mainfrom
inashivb:dcerpc-fraglen/v5
Closed

Dcerpc fraglen/v5#14733
inashivb wants to merge 3 commits intoOISF:mainfrom
inashivb:dcerpc-fraglen/v5

Conversation

@inashivb
Copy link
Member

@inashivb inashivb commented Feb 2, 2026

Link to ticket: https://redmine.openinfosecfoundation.org/issues/7546

Previous PR: #14731

Changes since v4:

  • clippy warning fixed

The parser could receive an input that consists of arbitrary data post
gap. This is handled in the beginning of the fn handle_input_data.
However, the rest of the calculation does not take into account the
bytes that were consumed at this stage. Fix the indices and calculations
to consider a new DCERPC fragment beginning post these consumed bytes.
So far, the fraglen defined in the header was used inconsistently in
certain places to define bounds on input length. Make it consistent by
making sure that only a slice up until fraglen is passed around as that
is the maximum length the fragment should have.
With the help of Applayer::incomplete API, the case when the
stream_slice passed to the parser is smaller than the header defined
fraglen is already handled.

Bug 7546
Unittests test_parse_bind_pdu_infinite_loop and
test_parse_bindack_pdu_infinite_loop seem to have artificially made up
header which does not hold up to the strict calculations enforced by the
parser now. Their headers mark the fraglens as 64 and 72 respectively
which are not enough to hold the kind of bind(ack) items that are expected.
It worked so far as the parser passed the entire input slice around but
with the bugfix for issue 7546, the input passed around is strictly
restricted to the fraglen parsed in the header.

Bug 7546
@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.16%. Comparing base (81572cb) to head (6c211fd).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14733      +/-   ##
==========================================
- Coverage   82.17%   82.16%   -0.02%     
==========================================
  Files        1008     1008              
  Lines      263916   263893      -23     
==========================================
- Hits       216868   216817      -51     
- Misses      47048    47076      +28     
Flag Coverage Δ
fuzzcorpus 60.19% <95.55%> (-0.01%) ⬇️
livemode 18.71% <0.00%> (+<0.01%) ⬆️
netns 18.52% <0.00%> (+<0.01%) ⬆️
pcap 44.61% <86.66%> (-0.01%) ⬇️
suricata-verify 65.35% <88.88%> (-0.02%) ⬇️
unittests 59.35% <75.55%> (-0.01%) ⬇️

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

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

@inashivb inashivb marked this pull request as ready for review February 2, 2026 11:23
@inashivb inashivb requested a review from jasonish as a code owner February 2, 2026 11:23
@catenacyber
Copy link
Contributor

Should there be SV tests ?

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline = 29357

@inashivb
Copy link
Member Author

inashivb commented Feb 4, 2026

Is this ok for you then, @catenacyber ?

@victorjulien victorjulien added this to the 9.0 milestone Feb 4, 2026
@catenacyber
Copy link
Contributor

Is this ok for you then, catenacyber ?

If it is ok for Victor, this is ok for me ;-)

@victorjulien
Copy link
Member

Merged in #14750, thanks!

@inashivb inashivb deleted the dcerpc-fraglen/v5 branch February 5, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants