Back to skill

Security audit

Openclaw Sentry

Security checks for vulnerabilities and agentic risk

Overview

The skill is a local secret scanner, but it also ships under-disclosed file-changing commands with weak workspace containment and unsafe plaintext backups.

Install only if you want a local workspace secret scanner and are prepared to control which commands agents run. Prefer using scan, check, and status. Treat redact, quarantine, unquarantine, defend, and protect as high-impact operations: run them only on trusted workspace-relative paths, review backups and quarantine contents, and rotate any credential that was ever exposed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/sentry.py:482
Finding

Unvalidated file paths permit operations outside the selected workspace

Content
View full analysis
0: # Create .bak backup before modifying bak = filepath.with_suffix(filepath.suffix + ".bak") shutil.copy2(filepath, bak) # Write redacted content filepath.write_text("\n".join(new_lines), encoding="utf-8") return total_redacted, findings ``` ```python if filepath: fpath = workspace / filepath if not fpath.exists(): print(f"File not found: {filepath}") return 1 if is_binary(fpath): print(f"Skipping binary file: {filepath}") return 0 count, findings = _redact_file(fpath, workspace) ``` The quarantine and restoration commands use the same unsafe path construction: ```python def cmd_quarantine(workspace, filepath): """Move a file containing secrets to quarantine with metadata.""" fpath = workspace / filepath if not fpath.exists(): print(f"File not found: {filepath}") return 1 # Scan the file first findings = [] if not is_binary(fpath): findings = scan_file(fpath, workspace) # Create quarantine directory qdir = quarantine_base(workspace) qdir.mkdir(parents=True, exist_ok=True) # Determine quarantine destination (preserve relative structure) rel = Path(filepath) dest = qdir / rel dest.parent.mkdir(parents=True, exist_ok=True) # Move file to quarantine shutil.move(str(fpa ...[truncated 2898 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sentry.py:525
Finding

Redaction leaves original secrets in predictable plaintext backup files

Content
View full analysis
0: # Create .bak backup before modifying bak = filepath.with_suffix(filepath.suffix + ".bak") shutil.copy2(filepath, bak) # Write redacted content filepath.write_text("\n".join(new_lines), encoding="utf-8") ``` ### Technical Analysis Before replacing detected credentials, the program copies the complete original file to a predictable `.bak` location. This backup retains all original credentials in plaintext. The backup is placed adjacent to the source file and is not protected with explicitly restrictive permissions. Although `copy2` commonly preserves source metadata, the implementation does not verify the resulting permissions or account for platform-specific behavior. It also does not use exclusive creation, so an existing backup can be overwritten. The generated `.gitignore` patterns do not include a general `*.bak` rule. Consequently, a user may believe redaction removed credentials while the unredacted data remains available for accidental version-control commits, indexing, synchronization, or later workspace scans. ### Attack Path 1. A workspace file contains a credential matching one of the scanner's regular expressions. 2. The user runs: ```bash python3 scripts/sentry.py redact sensitive.conf --workspace /path/to/workspace ``` 3. The original content is copied to `sensitive.conf.bak`. 4. Only `sensitive.conf` is redacted. 5. The plaintext credential remains recoverable from `sensitive.conf.bak`. 6. The backup may subsequently be committed, synchronized, indexed, or read by another local process with access to the workspace. ### Impact Assessment This behavior undermines the confidentiality objective of redaction. Any secret in the original file remains exposed with the same substantive secu ...[truncated 545 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (31)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 40)May include surrounding context.

md
## What It Detects

- **AWS** — Access keys (AKIA...), secret access keys
- **GitHub** — Personal access tokens (ghp_, gho_, ghs_, ghr_, github_pat_)
- **Slack** — Bot/user tokens (xox...), webhook URLs
- **Stripe** — Secret keys (sk_live_), publishable keys (pk_live_)
- **OpenAI** — API keys (sk-...)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 51)May include surrounding context.

md
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

md
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 58)May include surrounding context.

md
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 286)May include surrounding context.

python
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 304)May include surrounding context.

python
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 845)May include surrounding context.

python
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 934)May include surrounding context.

python
- **Private Keys** — PEM files, .key/.pem/.p12/.pfx extensions
- **Database URLs** — PostgreSQL, MySQL, MongoDB, Redis with credentials
- **JWT Tokens** — JSON Web Tokens in plain text
- **Environment Files** — .env files with variables
- **.gitignore gaps** — Missing patterns for common secret files

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The README advertises moving .env files to a vault path, which is a credential-handling action affecting highly sensitive files. In an agent workspace, automatically relocating .env files without strong safeguards can disrupt applications, accidentally expose secrets through incorrect destination handling, or enable unintended manipulation of credential stores.

Content

Scanner excerpt · README.md (reported line 63)May include surrounding context.

md
| **Auto-redact secrets in files** | - | Yes |
| **Quarantine leaking skills** | - | Yes |
| **Generate .gitignore rules** | - | Yes |
| **Move .env to vault path** | - | Yes |

## Exit Codes

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 100)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 121)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 291)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 329)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 100)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 100)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 100)May include surrounding context.

python
]

HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 101)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 129)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 329)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 101)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 131)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 329)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 102)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 132)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/sentry.py (reported line 102)May include surrounding context.

python
HIGH_RISK_FILES = {
    ".env", ".env.local", ".env.production", ".env.staging", ".env.development",
    "credentials.json", "service-account.json", "secrets.json",
    ".npmrc", ".pypirc", ".netrc", ".pgpass", ".my.cnf",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa",
}

Static analysis

No suspicious patterns detected.