Skip to content
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
47bab55
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 18, 2026
7ab5ba1
ci: repair command-injection detector review findings
seonghobae Aug 18, 2026
fe3bf9e
fix(sast): distinguish Python shell execution APIs
github-actions[bot] Aug 18, 2026
b97ab9f
ci: remove completed command-injection repair authority
seonghobae Aug 18, 2026
12350c8
ci: verify nested subprocess command-injection detection
seonghobae Aug 18, 2026
c0ed77c
ci: replace nested subprocess regex with AST validation
seonghobae Aug 18, 2026
0914323
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 18, 2026
4b5d402
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 18, 2026
aee3876
ci: verify final command-injection detector repair
seonghobae Aug 19, 2026
b0dfcb6
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 19, 2026
ac59920
ci: verify AST-backed Python shell detection
seonghobae Aug 20, 2026
dd681ab
ci: checkout the repair branch before verification
seonghobae Aug 20, 2026
588469f
chore(ci): remove completed PR 983 repair authority
seonghobae Aug 20, 2026
9512361
ci: execute bounded AST command-injection repair
seonghobae Aug 20, 2026
abb1b52
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
5272458
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
952fa20
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
40c4d24
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
9a3b17e
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
56e15f1
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
3f9db72
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
c8cf4d2
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 20, 2026
d484a85
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 21, 2026
59dcc82
πŸ›‘οΈ Sentinel: detect deeply nested Python shell calls
seonghobae Aug 21, 2026
bdc529e
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 21, 2026
46cbbd8
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Aug 26, 2026
ae7899f
Merge branch 'develop' into sentinel-fix-python-command-injection-reg…
opencode-agent[bot] Aug 26, 2026
982abcb
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Sep 26, 2026
45d4eab
merge: preserve protected threat-model and scanner fix
seonghobae Sep 26, 2026
f29064a
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Sep 26, 2026
50afdd6
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Sep 28, 2026
ec65860
πŸ›‘οΈ Sentinel: [CRITICAL] Fix python command injection rule to detect o…
seonghobae Sep 28, 2026
935ec31
πŸ›‘οΈ Sentinel: detect deeply nested Python shell calls
seonghobae Sep 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@
**Vulnerability:** The `/api/v1/webhook` POST endpoint in `appguardrail_core/controlplane.py` failed to validate the `url` property when accepting it into the database, leading to Stored SSRF risks. In addition, the core SSRF validation logic (`_is_safe_url`) in both the CLI and control-plane did not verify the input type (e.g. `isinstance(url, str)`). Passing non-string types (like integers) resulted in unhandled `AttributeError` exceptions inside `urllib.parse.urlparse`, which led to API 500 crashes on malicious JSON payloads.
**Learning:** Network endpoints must explicitly validate the data type of user-provided configurations prior to execution or storage. Furthermore, webhooks configured by users should always be checked for SSRF when saved, as trusting them later assumes input has already been safely validated, bypassing downstream network guardrails.
**Prevention:** Apply `_is_safe_url` checks directly upon ingestion (e.g., in `/api/v1/webhook`) and enforce type checks `if not isinstance(url, str): return False` prior to using library parsing functions like `urlparse`. Always return gracefully failing responses (like `400 Bad Request`) for unsafe URLs instead of allowing unhandled 500 server errors.
## 2026-08-05 - Missing os.system command injection detection
**Vulnerability:** The static analysis scanner's `python-command-injection` rule failed to detect command injections via `os.system` and `os.popen`.
**Learning:** The previous regular expression assumed `os.system` and `os.popen` accepted a `shell=True` argument similar to `subprocess.run`, leading to false negatives as they execute via the shell implicitly and don't accept `shell=True`.
**Prevention:** Ensure static analysis regex rules handling different APIs group them accurately according to their respective signatures rather than merging them under a single mandatory condition (like `shell=True`). Added tests to prevent regression.
2 changes: 1 addition & 1 deletion scanner/cli/appguardrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def _console_print(*values, **kwargs) -> None:
{
"id": "python-command-injection",
"pattern": re.compile(
r"(?i)(?:os\.system|subprocess\.(?:Popen|run|call|check_call|check_output))\s*\([^)]*shell\s*=\s*True"
r"(?i)(?:os\.(?:system|popen)\s*\(|subprocess\.(?:Popen|run|call|check_call|check_output)\s*\([^)]*shell\s*=\s*True)"
Comment thread
seonghobae marked this conversation as resolved.
Outdated
),
"severity": "CRITICAL",
"message": "Potential Command Injection detected: shell=True used in Python subprocess/os command. [OWASP A03:2021 - Injection]",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_appguardrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ def test_scan_file_detects_strix_derived_patterns(tmp_path):
"content": 'subprocess.run(f"ffmpeg -i {source_path}")\n',
"ids": {"python-subprocess-string-command"},
},
"cmd_injection.py": {
"content": "os.system(user_input)\nos.popen(cmd)\nsubprocess.call(cmd, shell=True)\n",
"ids": {"python-command-injection"},
},
Comment thread
seonghobae marked this conversation as resolved.
Outdated
"api.py": {
"content": "raise HTTPException(status_code=500) from exc\n",
"ids": {"http-exception-chains-internal-error"},
Expand Down
Loading