-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vuln OSV-2024-947 #1699
base: dev
Are you sure you want to change the base?
Fix vuln OSV-2024-947 #1699
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1699 +/- ##
==========================================
- Coverage 83.16% 83.15% -0.01%
==========================================
Files 279 279
Lines 48536 48538 +2
Branches 10507 10508 +1
==========================================
- Hits 40363 40361 -2
- Misses 7046 7047 +1
- Partials 1127 1130 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@aled-ua could you check why the CI failed? |
emmm, I'm not sure. Looks like the download failed?
|
while (remainingLen > 0) | ||
{ | ||
// Ensure there is enough remaining length for a new entry | ||
if (remainingLen < sizeof(SomeIpSdEntry::someipsdhdrentry)) | ||
{ | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do:
while (remainingLen > sizeof(SomeIpSdEntry::someipsdhdrentry))
{
entry = new SomeIpSdEntry(this, offset);
...
}
[Warning] This PR is generated by AI
PR Title: Fix for Heap-Buffer-Overflow Vulnerability in PcapPlusPlus - OSV-2024-947
PR Description:
pcpp::SomeIpSdLayer::getEntries()
when attempting to create newSomeIpSdEntry
objects without properly checking if sufficient memory is available in the buffer. This leads to access beyond the allocated memory, causing a heap-buffer-overflow.getEntries
function to ensure the remaining buffer length is adequate before creating a newSomeIpSdEntry
object. If the length is insufficient, the loop terminates, preventing out-of-bounds access. This fix enhances the program's security and stability by preventing invalid memory access.Sanitizer Report Summary: The AddressSanitizer report identified a heap-buffer-overflow when the program attempted to access 1 byte beyond a 66-byte allocated buffer. The issue occurs in
pcpp::SomeIpSdEntry::SomeIpSdEntry
and is triggered via thepcpp::SomeIpSdLayer::getEntries()
function. The root cause is the lack of a bounds check before creating a newSomeIpSdEntry
object.Full Sanitizer Report:
Files Modified:
Packet++/src/SomeIpSdLayer.cpp
Patch Validation: The patch has been validated using the provided PoC, and the heap-buffer-overflow vulnerability has been resolved. No new issues have been introduced.
Links: