Skip to content

fix: remove unsafe exec() in jni_helper.cpp#2018

Open
orbisai0security wants to merge 1 commit into
chen08209:mainfrom
orbisai0security:fix-null-check-malloc-jni-helper
Open

fix: remove unsafe exec() in jni_helper.cpp#2018
orbisai0security wants to merge 1 commit into
chen08209:mainfrom
orbisai0security:fix-null-check-malloc-jni-helper

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix critical severity security issue in android/core/src/main/cpp/jni_helper.cpp.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File android/core/src/main/cpp/jni_helper.cpp:28
CWE CWE-190

Description: In jni_helper.cpp at line 28, memory is allocated via malloc(length + 1) and the return value is never checked for NULL before the buffer is used. If malloc returns NULL due to memory exhaustion or an integer overflow in the length calculation, any subsequent write to the returned pointer results in a NULL pointer dereference (write to address 0), causing a crash or, on systems without NULL-page protection, potential arbitrary code execution. An attacker who can supply crafted JNI input to exhaust memory or trigger a large allocation can exploit this path directly.

Changes

  • android/core/src/main/cpp/jni_helper.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