openclaw - 💡(How to fix) Fix [Bug]: Obfuscated command detection blocks ALL `python3 -c` inline code, not just encoded payloads [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61977Fetched 2026-04-08 03:10:32
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

OpenClaw 2026.4.1 blocks all python3 -c "..." inline commands with:

"Obfuscated command detected: Python/Perl/Ruby with base64 or encoded execution"

This triggers even for simple, readable Python one-liners:

python3 -c "import sqlite3; print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])"

Root Cause

OpenClaw 2026.4.1 blocks all python3 -c "..." inline commands with:

"Obfuscated command detected: Python/Perl/Ruby with base64 or encoded execution"

This triggers even for simple, readable Python one-liners:

python3 -c "import sqlite3; print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])"

Fix Action

Workaround

Write Python to a file first, then execute:

cat > /tmp/script.py << 'EOF'
import sqlite3
print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])
EOF
python3 /tmp/script.py

Code Example

python3 -c "import sqlite3; print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])"

---

cat > /tmp/script.py << 'EOF'
import sqlite3
print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])
EOF
python3 /tmp/script.py
RAW_BUFFERClick to expand / collapse

Description

OpenClaw 2026.4.1 blocks all python3 -c "..." inline commands with:

"Obfuscated command detected: Python/Perl/Ruby with base64 or encoded execution"

This triggers even for simple, readable Python one-liners:

python3 -c "import sqlite3; print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])"

Expected Behavior

The detector should only flag actually obfuscated commands (base64-encoded payloads, hex-encoded strings, eval()/exec() with encoded input). Readable inline Python should be allowed.

Actual Behavior

ALL python3 -c commands are blocked regardless of content. This breaks agent workflows that use inline Python for DB queries, JSON processing, or API calls.

Workaround

Write Python to a file first, then execute:

cat > /tmp/script.py << 'EOF'
import sqlite3
print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])
EOF
python3 /tmp/script.py

Suggestion

  • Allow whitelisting inline Python for trusted skills
  • Or narrow detection to only flag base64/hex-encoded payloads, not all inline code
  • Related: #50576 (elevated=full does not work)

extent analysis

TL;DR

The issue can be mitigated by writing Python code to a file and executing it, rather than using inline commands with python3 -c.

Guidance

  • The current implementation of OpenClaw 2026.4.1 is overly broad, flagging all python3 -c commands as obfuscated, regardless of content.
  • To verify the issue, try running a simple, readable Python one-liner with python3 -c and observe if it is blocked by OpenClaw.
  • Consider implementing a whitelist for trusted skills or narrowing the detection to only flag base64/hex-encoded payloads, as suggested in the issue.
  • As a temporary workaround, use the suggested method of writing Python code to a file and executing it, as shown in the example.

Example

cat > /tmp/script.py << 'EOF'
import sqlite3
print(sqlite3.connect('db.sqlite').execute('SELECT count(*) FROM issues').fetchone()[0])
EOF
python3 /tmp/script.py

Notes

The provided workaround may not be suitable for all use cases, especially those that rely heavily on inline Python commands. A more permanent solution would involve modifying the OpenClaw detection mechanism to be more nuanced.

Recommendation

Apply workaround: writing Python code to a file and executing it, as this allows for continued use of Python scripts while avoiding the overly broad detection mechanism in OpenClaw 2026.4.1.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING