Skip to content

fix: remove unsafe exec() in NAImage.c#65

Open
orbisai0security wants to merge 1 commit into
Manderby:mainfrom
orbisai0security:fix-naimage-integer-overflow-v001
Open

fix: remove unsafe exec() in NAImage.c#65
orbisai0security wants to merge 1 commit into
Manderby:mainfrom
orbisai0security:fix-naimage-integer-overflow-v001

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix critical severity security issue in code/NALib/src/NAVisual/Core/NAImage.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File code/NALib/src/NAVisual/Core/NAImage.c:111

Description: The NAImage component allocates pixel data buffers using naMalloc(na_GetImageDataSize(image)) at line 111 and naMalloc(dataSize) at line 135. Image dimensions (width, height, bytes-per-pixel) are read from attacker-controlled file content without overflow-safe validation. The multiplication in na_GetImageDataSize can overflow a fixed-width integer when given large dimension values, producing a near-zero allocation size. Subsequent pixel data writes then overflow the undersized buffer into adjacent heap memory, enabling heap metadata corruption and arbitrary code execution.

Changes

  • code/NALib/src/NAVisual/Core/NAImage.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

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