Skip to content

fix: remove unsafe exec() in ANMLLexer.cpp#194

Open
orbisai0security wants to merge 1 commit into
nasa:masterfrom
orbisai0security:fix-fix-v-002-anml-lexer-double-free-use-after-free
Open

fix: remove unsafe exec() in ANMLLexer.cpp#194
orbisai0security wants to merge 1 commit into
nasa:masterfrom
orbisai0security:fix-fix-v-002-anml-lexer-double-free-use-after-free

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix high severity security issue in src/PLASMA/ANML/base/ANMLLexer.cpp.

Vulnerability

Field Value
ID V-002
Severity HIGH
Scanner multi_agent_ai
Rule V-002
File src/PLASMA/ANML/base/ANMLLexer.cpp:428

Description: The ANML lexer and parser use manual memory management via ANTLR3_FREE and ANTLR3_CALLOC. Error paths in ANMLLexer.cpp (lines 428-432, 501) and ANMLParser.cpp (lines 471, 693) free the lexer/parser context (ctx) but do not set the pointer to NULL afterward. If any subsequent code path retains a reference to ctx and dereferences it after the free, a use-after-free condition occurs. Additionally, the free at line 501 in ANMLLexer.cpp may execute after a prior free at line 432 on the same ctx pointer, creating a double-free condition that corrupts heap metadata.

Changes

  • src/PLASMA/ANML/base/ANMLLexer.cpp

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