Skip to content

fix: in nvm_gd32 in nvm_gd32.cpp#2

Open
orbisai0security wants to merge 1 commit into
mean00:masterfrom
orbisai0security:fix-nvm-gd32-memcpy-bounds-check
Open

fix: in nvm_gd32 in nvm_gd32.cpp#2
orbisai0security wants to merge 1 commit into
mean00:masterfrom
orbisai0security:fix-nvm-gd32-memcpy-bounds-check

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix critical severity security issue in libraries/NeVerMind/gd32/nvm_gd32.cpp.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File libraries/NeVerMind/gd32/nvm_gd32.cpp:70

Description: In nvm_gd32.cpp at line 70, memcpy(data, adr, size) copies 'size' bytes from the source address 'adr' into the destination buffer 'data' without first validating that 'size' does not exceed the capacity of the destination buffer. In embedded firmware, NVM (non-volatile memory) content can be influenced by an attacker through a crafted firmware update, a malicious NVM image, or corruption of peripheral input. An oversized 'size' value causes the memcpy to write beyond the destination buffer boundary, overwriting adjacent stack memory including return addresses and function pointers.

Changes

  • libraries/NeVerMind/gd32/nvm_gd32.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