Skip to content

fix: remove unsafe exec() in 0x0012-writefile.c#2

Open
orbisai0security wants to merge 1 commit into
mytechnotalent:mainfrom
orbisai0security:fix-v-002-writefile-format-string-and-bool-check
Open

fix: remove unsafe exec() in 0x0012-writefile.c#2
orbisai0security wants to merge 1 commit into
mytechnotalent:mainfrom
orbisai0security:fix-v-002-writefile-format-string-and-bool-check

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix critical severity security issue in 0x0012-writefile/0x0012-writefile.c.

Vulnerability

Field Value
ID V-002
Severity CRITICAL
Scanner multi_agent_ai
Rule V-002
File 0x0012-writefile/0x0012-writefile.c:1

Description: The writefile (and potentially copyfile) module uses sprintf() to format strings into fixed-size stack buffers without specifying a maximum output length. sprintf() has no built-in bounds checking — it writes as many bytes as the formatted output requires, regardless of the destination buffer's capacity. An attacker who can control the input data (such as a filename or file path) can supply a string long enough to overflow the buffer, overwrite adjacent stack memory including the saved return address, and redirect program execution to attacker-controlled code.

Changes

  • 0x0012-writefile/0x0012-writefile.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