fix: at hide_soinfo in hide_soinfo.c#14
Open
orbisai0security wants to merge 1 commit into
Open
Conversation
Automated security fix generated by OrbisAI Security
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
agent/src/hide_soinfo.c.Vulnerability
V-007agent/src/hide_soinfo.c:128Description: At hide_soinfo.c line 128, the heap allocation size is computed by multiplying ehdr.e_shnum (read directly from an untrusted ELF binary header) by sizeof(Elf64_Shdr) (64 bytes). On 32-bit systems or when extended section counts are used (stored in section 0's sh_size field as a 32-bit value), an attacker can supply e_shnum=0xFFFFFFFF, causing the multiplication 0xFFFFFFFF * 64 to overflow the 32-bit size_t to a small value (e.g., 192 bytes). malloc() then allocates only 192 bytes, but the subsequent fread() attempts to read 0xFFFFFFFF * 64 bytes of section header data into this tiny buffer, causing a massive heap overflow. No overflow check exists before the multiplication.
Changes
agent/src/hide_soinfo.cVerification
Automated security fix by OrbisAI Security