T09 · Insecure Skill Coding Practices
- Location
canary.py:97- Finding
Protected Path Controls Can Be Bypassed Through Symbolic Links
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This security-monitoring skill is not clearly malicious, but its protection claims are stronger than the implementation and it can store sensitive command or path data in plaintext logs.
Install only if you treat Canary as a best-effort advisory monitor, not a sandbox or reliable security boundary. Use OS permissions, containers, and real auditing for enforcement; avoid passing secrets in command strings; restrict log and tripwire file permissions; and verify any claimed rate-limit or protected-path behavior in your own environment before relying on it.
canary.py:97Protected Path Controls Can Be Bypassed Through Symbolic Links
canary_tripwire.py:144Tripwire Integrity Checks Can Generate Their Own Access Alerts
canary.py:97Configured File and Network Rate Limits Are Not Enforced
canary.py:140Commands and File Paths Are Stored Verbatim in Plaintext Logs
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Example:
# This is blocked:
canary.check_command('rm -rf /')
# This might NOT be blocked (obfuscated):
canary.check_command('r''m -rf /') # Space in command name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
canary.check_command('rm -rf /')
canary.check_command('r''m -rf /') # Space in command name canary.check_command('RM -RF /') # Case may bypass patterns
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
canary.check_command('r''m -rf /') # Space in command name canary.check_command('RM -RF /') # Case may bypass patterns
**Why:** Full semantic analysis requires complex parsing and execution simulation.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
canary.check_command('r''m -rf /') # Space in command name canary.check_command('RM -RF /') # Case may bypass patterns
**Why:** Full semantic analysis requires complex parsing and execution simulation.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
**Limitation:** Canary checks actions but doesn't enforce sandboxing.
**Example:**
- Canary blocks `rm /etc/passwd`
- Agent can still try to run it (Canary just logs it)
- Enforcement depends on agent respecting Canary's response
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
res OS-level isolation (containers, VMs, chroot).
Workaround:
Limitation: Patterns can be bypassed with base64, hex, or other encoding.
Example:
# This is blocked:
rm -rf /
# This might NOT be blocked:
echo "cm0gLXJmIC8=" | base64 -d | sh # Decodes to "rm -rf /"
Why: Detecting all encoding schemes is intractable.
Workaround:
base64 -d, echo | sh)Limitation: Canary doesn't modify file system permissions.
Example:
~/.ssh/Why: Files
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**Workaround:**
- Use OS permissions + Canary together
- Set restrictive file permissions (`chmod 600 ~/.ssh/id_rsa`)
- Run agent with limited user account
---
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
**Forbidden Patterns:**
- Regular expression matching for dangerous commands
- Detects `rm -rf /`, `chmod 777`, `curl | sh`, etc.
- Extensible pattern library
**Rate Limiting:**
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
**Forbidden Patterns:**
- Regular expression matching for dangerous commands
- Detects `rm -rf /`, `chmod 777`, `curl | sh`, etc.
- Extensible pattern library
**Rate Limiting:**
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
**Forbidden Patterns:**
- Regular expression matching for dangerous commands
- Detects `rm -rf /`, `chmod 777`, `curl | sh`, etc.
- Extensible pattern library
**Rate Limiting:**
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
**Forbidden Patterns:**
- Regular expression matching for dangerous commands
- Detects `rm -rf /`, `chmod 777`, `curl | sh`, etc.
- Extensible pattern library
**Rate Limiting:**
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
**Forbidden Patterns:**
- Regular expression matching for dangerous commands
- Detects `rm -rf /`, `chmod 777`, `curl | sh`, etc.
- Extensible pattern library
**Rate Limiting:**
No suspicious patterns detected.