Skip to content
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

\orchagent\p4orch\tests\acl_manager_test.cpp vulnerability in ip_type_bit_type_lookup #3468

Open
marwanelmessiry opened this issue Jan 14, 2025 · 0 comments

Comments

@marwanelmessiry
Copy link

Risk: The provided line of code introduces a potential buffer improper index access vulnerability. This can lead to several security risks:

Memory Leakage: Reading an array index outside of the array's bounds can leak arbitrary memory, which could contain sensitive information.
Memory Corruption: Writing to an array index outside of the array's bounds can result in arbitrary memory writes, leading to memory corruption.
Denial of Service: If the application crashes due to memory corruption, it can lead to a denial of service.
Arbitrary Code Execution: In some cases, an attacker may exploit this vulnerability to execute arbitrary code.
Cause: The vulnerability arises from the following issue in the code:

Lack of Bounds Checking and Input Validation: The code does not validate the key before adding it to the ip_type_bit_type_lookup map. Specifically, the line acl_table->ip_type_bit_type_lookup["invalid"] = "invalid"; adds a key that is clearly labeled as "invalid", which should not be part of the map. This can lead to unexpected behavior if the key is not well-formed or if it is manipulated by an attacker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant