Back to skill

Security audit

Snowsand Confluence

Security checks for vulnerabilities and agentic risk

Overview

This is a real Confluence management skill, but it gives broad live workspace authority with weak safeguards around API tokens, permanent deletes, and downloads.

Review before installing. Use a narrowly scoped Atlassian API token, verify CONFLUENCE_BASE_URL is exactly your HTTPS Confluence tenant, avoid raw curl workflows unless needed, require explicit human confirmation before delete or purge commands, and use an explicit safe output path when downloading attachments.

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
scripts/confluence.py:24
Finding
Confluence API Credentials Can Be Sent to an Unvalidated Network Destination<![CDATA[ ## Vulnerability Details **File Location**: `scripts/confluence.py:24-66`, with equivalent credential transmission at `scripts/confluence.py:82-138` and `scripts/confluence.py:449-466` **Vulnerability Type**: Unvalidated authentication destination and potential plaintext credential transmission **Risk Level**: Medium ### Vulnerable Code ```python def get_config(): """Get Confluence configuration from environment.""" base_url = os.environ.get("CONFLUENCE_BASE_URL", "").rstrip("/") email = os.environ.get("CONFLUENCE_USER_EMAIL", "") token = os.environ.get("CONFLUENCE_API_TOKEN", "") if not all([base_url, email, token]): missing = [] if not base_url: missing.append("CONFLUENCE_BASE_URL") if not email: missing.append("CONFLUENCE_USER_EMAIL") if not token: missing.append("CONFLUENCE_API_TOKEN") print(f"Error: Missing environment variables: {', '.join(missing)}", file=sys.stderr) sys.exit(1) return base_url, email, token def make_request(method, endpoint, data=None, params=None, api_version="v2"): """Make authenticated request to Confluence API.""" base_url, email, token = get_config() if api_version == "v2": url = f"{base_url}/wiki/api/v2{endpoint}" else: url = f"{base_url}/wiki/rest/api{endpoint}" if params: url = f"{url}?{urlencode(params)}" auth = base64.b64encode(f"{email}:{token}".encode()).decode() headers = { "Authorization": f"Basic {auth}", "Accept": "application/json", } body = None if data: headers["Content-Type"] = "application/json" body = json.dumps(data).encode() req = Request(url, data=body, headers=headers, method=method) try: with urlopen(req) as resp: ``` The same unsafe destination assumption is used for attachment upload: ```python def make_multipart_request(endpoint, file_path, comment=None): """Make ...[truncated 4356 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse `CONFLUENCE_BASE_URL` with `urllib.parse.urlsplit` before using it. 2. Require the `https` scheme and reject plaintext HTTP. 3. Reject URLs containing embedded user information, fragments, malformed hosts, or unexpected ports. 4. Bind authentication to an explicitly configured tenant hostname or hostname allowlist. For Confluence Cloud, permit only the exact expected Atlassian tenant rather than accepting an arbitrary URL. 5. Resolve and reject loopback, link-local, and private-network destinations unless private Confluence deployments are an explicitly supported use case. 6. Disable automatic redirects for authenticated requests or validate every redirect target. Never forward `Authorization` across origins. 7. Apply the same destination validation to normal API calls, multipart uploads, and attachment downloads. 8. Update the documented `curl` examples to require a validated HTTPS tenant URL. 9. Use a narrowly scoped API token with only the Confluence permissions required by the intended workflow. 10. Document token rotation and immediate revocation procedures in case a destination is misconfigured. 11. Avoid logging request headers or the Base64 authentication value during future debugging or error handling. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tainted flow: 'req' from os.environ.get (line 463, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
req = Request(url, data=body, headers=headers, method=method)
    
    try:
        with urlopen(req) as resp:
            content = resp.read().decode()
            return json.loads(content) if content else {}
    except HTTPError as e:
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.environ.get (line 463, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
req = Request(url, data=body, headers=headers, method=method)
    
    try:
        with urlopen(req) as resp:
            content = resp.read().decode()
            return json.loads(content) if content else {}
    except HTTPError as e:
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.environ.get (line 463, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
req = Request(url, headers=headers)
    
    try:
        with urlopen(req) as resp:
            output_path = args.output or att.get("title", "attachment")
            with open(output_path, "wb") as f:
                f.write(resp.read())
Confidence
90% confidence
Finding
The download path is taken from untrusted remote metadata: if --output is not provided, the code writes the downloaded attachment to att.get("title"), which is attacker-controlled attachment/page content in Confluence. A crafted attachment title containing path traversal sequences or an absolute path could cause arbitrary file overwrite in the local filesystem where the skill runs.

Ae1

High
Category
analysis-evasion
Content
All operations use the `scripts/confluence.py` script:
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill documents use of environment variables and direct network access to Confluence, but it does not declare any tool scope such as permissions or allowed-tools. In an agent environment, this weakens least-privilege controls and can allow unintended access to credentials or outbound requests if the skill is invoked unexpectedly.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger description is extremely broad, covering essentially any Confluence or documentation-related task. This increases the chance the skill is auto-selected in situations the user did not intend, which is especially risky because the skill includes write and delete operations against a live SaaS workspace.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation shows page deletion and permanent purge commands without strong warnings, confirmation requirements, or rollback guidance. In a skill that can act on production documentation, omission of safety prompts materially raises the risk of accidental destructive actions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The attachment deletion examples include permanent purge operations without cautionary language or approval requirements. Because attachments may contain important records or artifacts, presenting purge as a normal workflow can lead to irreversible loss.

External Transmission

Medium
Category
Data Exfiltration
Content
"$CONFLUENCE_BASE_URL/wiki/rest/api/content?type=page&limit=5" | jq .

# POST with body
curl -s -X POST -u "$CONFLUENCE_USER_EMAIL:$CONFLUENCE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"spaceId":"12345","title":"Test","body":{"representation":"storage","value":"<p>Hello</p>"}}' \
  "$CONFLUENCE_BASE_URL/wiki/api/v2/pages" | jq .
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.