Skip to content

fix: add buffer-length check in main.c#29

Merged
tefletch merged 1 commit into
tefletch:masterfrom
orbisai0security:fix-v001-sprintf-buffer-overflow
May 20, 2026
Merged

fix: add buffer-length check in main.c#29
tefletch merged 1 commit into
tefletch:masterfrom
orbisai0security:fix-v001-sprintf-buffer-overflow

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix high severity security issue in packages/gscope4/src/main.c.

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File packages/gscope4/src/main.c:248
CWE CWE-120

Description: Five sprintf() calls in packages/gscope4/src/main.c write into fixed-size stack or heap buffers (ui_file, path) using ui_file_path and the HOME environment variable as inputs, without any bounds checking. Because HOME is fully attacker-controlled by any local user, setting it to a string exceeding the destination buffer size causes a stack buffer overflow when main.c:574 executes. The same pattern at lines 248, 254, 262, and 270 is exploitable if ui_file_path is influenced by environment variables or command-line arguments.

Changes

  • packages/gscope4/src/main.c

Verification

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

Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
@tefletch
Copy link
Copy Markdown
Owner

Need to make analogous changes to GTK2 and GTK3 version-unique main.c files

@tefletch tefletch merged commit c2ceb1c into tefletch:master May 20, 2026
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.

3 participants