Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1680 +/- ##
==========================================
- Coverage 83.16% 83.15% -0.01%
==========================================
Files 277 277
Lines 48193 48203 +10
Branches 9966 9948 -18
==========================================
+ Hits 40081 40085 +4
- Misses 7234 7268 +34
+ Partials 878 850 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
seladb
approved these changes
Jan 8, 2025
Owner
|
Thank you @aled-ua for working on this fix, much appreciated! 🙏 |
cla7aye15I4nd
pushed a commit
to oss-patch/PcapPlusPlus
that referenced
this pull request
Jan 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Warning] This PR is generated by AI
Pull Request Description for Fixing Vulnerability - OSV-2024-343
pcapplusplus- OSV-2024-343pcapplusplusproject where a heap-buffer-overflow occurred due to an out-of-bounds memory access in theBgpUpdateMessageLayerclass. This issue was detected in the functiongetPathAttributesLength()which is part ofBgpLayer.cpp. The vulnerability allows memory access outside of allocated bounds, potentially leading to undefined behavior or program crashes.getPathAttributesLength()function to ensure that the memory access remains within the allocated buffer's limits. Specifically, the fix checks the calculated offset against the total buffer size (headerLen) and returns0if the access is invalid. This modification effectively prevents the heap-buffer-overflow by ensuring all accesses are safe and within bounds.pcapplusplusprogram by ensuring robust handling of invalid memory access scenarios.The sanitizer detected a heap-buffer-overflow error in the function
getPathAttributesLength()located inBgpLayer.cpp:546. The issue was caused by accessing heap memory beyond its allocated size, and the error was triggered during fuzz testing. The stack trace indicated that the vulnerability propagates through thesetPathAttributesandclearPathAttributesfunctions, leading to an invalid memory access in thereadParsedPacketfunction during fuzzing.Files Modified:
The patch modifies the following file:
Packet++/src/BgpLayer.cppThe patch has been validated using the provided PoC and fuzzing tools. The heap-buffer-overflow issue reported in the sanitizer report has been resolved. Additionally, no new issues or regressions were introduced during the testing process.
Please review and merge the patch to ensure that the program is secure and stable. Thank you!