Skip to content

fix: OS Command Injection in systemDiagnostics / systemDebug - #1

Open
MBK-fr wants to merge 1 commit into
masterfrom
darkmoon/fix-os-command-injection-system-diagnostics
Open

MBK-fr wants to merge 1 commit into
masterfrom
darkmoon/fix-os-command-injection-system-diagnostics

Conversation

@MBK-fr

@MBK-fr MBK-fr commented Nov 21, 2026

Copy link
Copy Markdown

Findings

Darkmoon campaign camp_20261119_c80c95bf (DVGA demo target).

Finding Severity Title Endpoint
vuln_ea9e55 critical Remote Code Execution via systemDiagnostics Query http://dvga.demo.invalid:5013/graphql
vuln_5e0da8 critical OS Command Injection via systemDiagnostics GraphQL Query - RCE from Browser /graphql (systemDiagnostics query with cmd parameter)
vuln_2d0755 critical OS File Read via systemDiagnostics RCE - /etc/passwd Exfiltrated http://dvga.demo.invalid:5013/graphql
vuln_369231 critical Sensitive File Read via RCE - /etc/passwd and Application Source Exposed /graphql (systemDiagnostics query)
vuln_271421 high Environment Variable Disclosure via RCE - Docker Container Secrets Exposed http://dvga.demo.invalid:5013/graphql
vuln_a38cb0 high Application Configuration File Disclosure via RCE - Debug Mode, DB Path, Security Settings http://dvga.demo.invalid:5013/graphql
vuln_c22c32 high Source Code Disclosure via RCE - Application Logic and Security Controls Exposed http://dvga.demo.invalid:5013/graphql

Fix

Replaces shell execution (os.popen) in systemDiagnostics and systemDebug with subprocess.run(shell=False) on a fixed allowlist of argv (whoami, uptime, date, ps) and a small allowlist of ps options; user input can no longer run arbitrary commands, read files, dump the environment or the application source.

Files changed:

  • core/helpers.py
  • core/security.py
  • core/views.py

Validation intent

Manual verification that the documented exploit path no longer succeeds, plus the project's existing test suite. Changed Python files pass python3 -m py_compile.

Opened for human review; never auto-merged.


Darkmoon finding reference: vuln_ea9e55, vuln_5e0da8, vuln_2d0755, vuln_369231, vuln_271421, vuln_a38cb0, vuln_c22c32.

Replaces shell execution (`os.popen`) in `systemDiagnostics` and `systemDebug` with `subprocess.run(shell=False)` on a fixed allowlist of argv (whoami, uptime, date, ps) and a small allowlist of `ps` options; user input can no longer run arbitrary commands, read files, dump the environment or the application source.

Findings: vuln_ea9e55, vuln_5e0da8, vuln_2d0755, vuln_369231, vuln_271421, vuln_a38cb0, vuln_c22c32
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