Skip to content

fix: five memcpy calls in tinystr in tinystr.cpp#197

Open
orbisai0security wants to merge 1 commit into
nasa:masterfrom
orbisai0security:fix-fix-tinystr-integer-overflow-v-001
Open

fix: five memcpy calls in tinystr in tinystr.cpp#197
orbisai0security wants to merge 1 commit into
nasa:masterfrom
orbisai0security:fix-fix-tinystr-integer-overflow-v-001

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix high severity security issue in src/PLASMA/TinyXml/base/tinystr.cpp.

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File src/PLASMA/TinyXml/base/tinystr.cpp:53
CWE CWE-190

Description: Five memcpy calls in tinystr.cpp copy data into heap-allocated buffers without validating that the source length fits within the destination buffer. The size variable newlen is computed from the source string length (e.g., strlen(instring) + 1) and used both to allocate the buffer and to copy data, but there is no guard against integer overflow in the size computation or mismatch between allocated size and copy size. A crafted XML document with oversized string values can overflow the heap buffer, overwriting adjacent heap metadata or function pointers.

Changes

  • src/PLASMA/TinyXml/base/tinystr.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