Back to skill

Security audit

Chmod Calc

Security checks for vulnerabilities and agentic risk

Overview

This is a simple chmod permission calculator skill with no bundled code, persistence, network access, or automatic execution, though its symbolic chmod examples can be misleading for restrictive changes.

Reasonable to install as a reference tool, but prefer the numeric chmod command for exact permission changes. Treat generated symbolic commands with caution because additive forms like u+rw,g+r may not remove permissions that already exist.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:43
Finding

Generated Symbolic chmod Commands Fail to Remove Unrequested Permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 43–48
Vulnerability Type: Inexact permission enforcement through additive chmod operations
Risk Level: Medium

Vulnerable Code Snippet:

markdown
### Symbolic chmod command format
Build clauses for each entity with permissions set:
- `u` = owner, `g` = group, `o` = others
- Emit `{entity}+{perms}` for each entity that has any permissions
- Special bits: `u+s` (setuid), `g+s` (setgid), `+t` (sticky)

Technical Analysis

The Skill instructs the agent to generate symbolic chmod commands using additive (+) clauses and to omit entities that have no requested permissions. Additive clauses only enable specified permission bits; they do not remove permissions that are already present.

As a result, the generated symbolic command does not necessarily produce the numeric mode or symbolic state advertised by the Skill. For example, the documented conversion for mode 640 generates:

shell
chmod u+rw,g+r filename

If the target begins with mode 777, this command leaves it at 777 rather than changing it to 640. The command does not remove owner execute permissions or any permissions assigned to others. Existing setuid, setgid, and sticky bits may also remain enabled when they were not requested.

This creates a security-relevant mismatch between the reported target state and the actual state produced by the symbolic command.

Attack Path

  1. A sensitive target file already has excessive permissions, such as mode 777, or has an enabled special permission bit.
  2. The user asks the Skill to generate a restrictive permission setting, such as mode 640.
  3. The Skill produces the additive symbolic command chmod u+rw,g+r filename.
  4. The user executes that command believing it will enforce the advertised mode.
  5. Existing group, other, execute, setuid, setgid, or sticky bits that were not explicitly removed remain active.

...[truncated 839 chars]

Remediation
View remediation

Remediation Suggestions

Generate exact-state symbolic commands with assignment (=) rather than additive (+) operations. Include all three entities even when an entity should have no permissions. For example, mode 640 should produce:

shell
chmod u=rw,g=r,o= filename

Ensure that unrequested special bits are explicitly cleared, or state that the numeric command is the authoritative exact-state command. If symbolic commands remain supported, document and implement deterministic handling for setuid, setgid, and sticky bits.

Add tests that apply generated commands to targets with pre-existing permissive and special modes, including transitions from 777, 4755, 2755, and 1755 to restrictive modes. Verify the resulting mode with stat rather than checking only the generated command text.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

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).

Content

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

text
Numeric:          755
Symbolic:         rwxr-xr-x
Command (numeric):   chmod 755 filename
Command (symbolic):  chmod u+rwx,g+rx,o+rx filename

Owner: read, write, execute

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
---
name: chmod-calc
description: Calculate chmod permissions — convert between numeric (octal) and symbolic notation, and generate the chmod command. Use when the user asks what chmod 755 means, how to set file permissions, or what symbolic notation rwxr-xr-x translates to.
---

# chmod Calculator

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
## Output
- Numeric notation (3 or 4 digits)
- Symbolic notation (9 characters, e.g. `rwxr-xr-x`)
- Numeric chmod command: `chmod 755 filename`
- Symbolic chmod command: `chmod u+rwx,g+rx,o+rx filename`
- Plain-English description of what each entity can do

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
## Output
- Numeric notation (3 or 4 digits)
- Symbolic notation (9 characters, e.g. `rwxr-xr-x`)
- Numeric chmod command: `chmod 755 filename`
- Symbolic chmod command: `chmod u+rwx,g+rx,o+rx filename`
- Plain-English description of what each entity can do

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
## Output
- Numeric notation (3 or 4 digits)
- Symbolic notation (9 characters, e.g. `rwxr-xr-x`)
- Numeric chmod command: `chmod 755 filename`
- Symbolic chmod command: `chmod u+rwx,g+rx,o+rx filename`
- Plain-English description of what each entity can do

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

text
Numeric:          644
Symbolic:         rw-r--r--
Command (numeric):   chmod 644 filename
Command (symbolic):  chmod u+rw,g+r,o+r filename

Owner: read, write

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

text
Numeric:          640
Symbolic:         rw-r-----
Command (numeric):   chmod 640 filename
Command (symbolic):  chmod u+rw,g+r filename

Static analysis

No suspicious patterns detected.