fix: add bounds check before memcpy in dp_rte_flow.c#789
Open
orbisai0security wants to merge 3 commits into
Open
fix: add bounds check before memcpy in dp_rte_flow.c#789orbisai0security wants to merge 3 commits into
orbisai0security wants to merge 3 commits into
Conversation
Automated security fix generated by OrbisAI Security
The function dp_get_icmp_err_ip_hdr() reads the IHL (Internet Header Length) field from an embedded IPv4 header within an ICMP error message and uses it to compute a memory offset (ihl * 4) for rte_memcpy without validating that the IHL value is within the valid range (5-15) or that the computed offset does not exceed the packet buffer length
Contributor
|
Hi, the test cannot work in this way. it has to integrate into the existing testing framework under |
…s check Move the IHL bounds-check coverage for dp_get_icmp_err_ip_hdr() into the existing /test/local pytest framework, which is the project's testing convention. Adds two integration tests that send crafted ICMP error packets with invalid (IHL=0, IHL=15) and valid (IHL=5) embedded IPv4 headers through a live dpservice instance and assert drop vs. forward behaviour respectively. Removes the standalone C file that used an unintegrated check.h framework. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Addressed. Pls review. |
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.
Summary
Fix critical severity security issue in
src/rte_flow/dp_rte_flow.c.Vulnerability
V-001src/rte_flow/dp_rte_flow.c:27Description: The function dp_get_icmp_err_ip_hdr() reads the IHL (Internet Header Length) field from an embedded IPv4 header within an ICMP error message and uses it to compute a memory offset (ihl * 4) for rte_memcpy without validating that the IHL value is within the valid range (5-15) or that the computed offset does not exceed the packet buffer length. An attacker-crafted ICMP error packet with an invalid IHL value causes out-of-bounds memory reads.
Evidence
Scanner confirmation: multi_agent_ai rule
V-001flagged this pattern.Production code: This file is in the production codebase, not test-only code.
Threat Model Context
This is a containerized service - vulnerabilities may be exploitable depending on network exposure.
Changes
src/rte_flow/dp_rte_flow.cVerification
Security Invariant
Regression test
This test guards against regressions — it's useful independent of the code change above.
Automated security fix by OrbisAI Security