secdev / scapy

Scapy: the Python-based interactive packet manipulation program & library.
https://scapy.net
GNU General Public License v2.0
10.81k stars 2.03k forks source link

Fix corruption of certain packets containing invalid TLS extension fields #4554

Closed arjunbhat1 closed 1 month ago

arjunbhat1 commented 1 month ago

Fixes #3853

Scapy's TLS layer corrupts packet data in some cases during dissection of TLS records containing invalid extension fields (extlen != len(ext)).

A corresponding unit test has been added as well.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.62%. Comparing base (c38a5de) to head (6cc0246). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4554 +/- ## ======================================= Coverage 81.61% 81.62% ======================================= Files 356 356 Lines 85540 85542 +2 ======================================= + Hits 69816 69824 +8 + Misses 15724 15718 -6 ``` | [Files with missing lines](https://app.codecov.io/gh/secdev/scapy/pull/4554?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=secdev) | Coverage Δ | | |---|---|---| | [scapy/layers/tls/extensions.py](https://app.codecov.io/gh/secdev/scapy/pull/4554?src=pr&el=tree&filepath=scapy%2Flayers%2Ftls%2Fextensions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=secdev#diff-c2NhcHkvbGF5ZXJzL3Rscy9leHRlbnNpb25zLnB5) | `83.90% <100.00%> (+0.10%)` | :arrow_up: | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/secdev/scapy/pull/4554/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=secdev)