Skip to content

fix: add integer overflow check in magic_kernel_sharp.c - #8

Open
anupamme wants to merge 1 commit into
sharpobject:masterfrom
anupamme:fix-repo-yisim-v-002-integer-overflow-calloc-magic-kernel-sharp
Open

anupamme wants to merge 1 commit into
sharpobject:masterfrom
anupamme:fix-repo-yisim-v-002-integer-overflow-calloc-magic-kernel-sharp

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Fix high severity security issue in scrape/magic_kernel_sharp.c.

Vulnerability

Field Value
ID V-002
Severity HIGH
Scanner multi_agent_ai
Rule V-002
File scrape/magic_kernel_sharp.c:162
Assessment Likely exploitable
CWE CWE-190

Description: Memory allocation calculations in magic_kernel_sharp.c multiply size_t values without overflow checking. Large image dimensions can cause integer overflow, resulting in undersized allocations. Subsequent writes based on original dimensions overflow the buffer.

Evidence

Exploitation scenario: An attacker provides a crafted image with dimensions designed to cause integer overflow.

Scanner confirmation: multi_agent_ai rule V-002 flagged this pattern.

Production code: This file is in the production codebase, not test-only code.

Changes

  • scrape/magic_kernel_sharp.c

Behavior Preservation

The change is scoped to 1 file on the vulnerable path.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
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

Successfully merging this pull request may close these issues.

1 participant