Skip to content

fix: remove unsafe exec() in fw2h.c#42

Open
orbisai0security wants to merge 1 commit into
lewisxhe:masterfrom
orbisai0security:fix-v-001-sprintf-buffer-overflow-fw2h
Open

fix: remove unsafe exec() in fw2h.c#42
orbisai0security wants to merge 1 commit into
lewisxhe:masterfrom
orbisai0security:fix-v-001-sprintf-buffer-overflow-fw2h

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix critical severity security issue in tools/fw2h/fw2h.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File tools/fw2h/fw2h.c:64

Description: The fw2h build tool uses the unsafe sprintf() function to construct an output filename by appending '.h' to a command-line argument (argv[i]). No bounds check is performed on the length of argv[i] relative to the size of the output_file_name stack buffer. Passing a filename argument longer than the allocated buffer will overflow the stack, potentially overwriting the saved return address and enabling arbitrary code execution.

Changes

  • tools/fw2h/fw2h.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