Skip to content

fix: add buffer-length check in browser.c#30

Merged
tefletch merged 1 commit into
tefletch:masterfrom
orbisai0security:fix-heap-buffer-overflow-browser-parse-results
May 20, 2026
Merged

fix: add buffer-length check in browser.c#30
tefletch merged 1 commit into
tefletch:masterfrom
orbisai0security:fix-heap-buffer-overflow-browser-parse-results

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix critical severity security issue in packages/gscope/src/browser.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File packages/gscope/src/browser.c:363
CWE CWE-120

Description: At browser.c:367, each result node allocates a fixed 1024-byte buffer (node->buf) to hold source file content, symbol names, or cscope database entries. There is no bounds checking enforced before data is written into this buffer. Any source file line, identifier, or cscope entry exceeding 1024 bytes will overflow into adjacent heap memory. This is a classic heap buffer overflow: the allocation size is hardcoded and does not adapt to the actual length of the data being stored.

Changes

  • packages/gscope/src/browser.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 tefletch merged commit 7bea17e 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.

2 participants