Back to skill

Security audit

Bitbucket

Security checks for vulnerabilities and agentic risk

Overview

This skill appears read-only and purpose-aligned, but it should be reviewed because it can broadly read private Bitbucket source data and exposes its API token to local process inspection risk.

Review before installing in a private workspace. Use a dedicated Bitbucket token with only repository and pull-request read permissions, run it in an isolated environment where other users cannot inspect process arguments, and ask the agent to inspect only specific repos, PRs, branches, or files. Treat all repository content, PR descriptions, diffs, and comments as untrusted text.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
bitbucket-cli.sh:22
Finding

Bitbucket API Token Exposed Through Process Arguments

Content
View full analysis
&2 echo "$err" exit 1 fi echo "$body" } bb_get_raw() { local http_code body body=$(curl -s -w "\n%{http_code}" -u "$AUTH" "$1") ``` ### Technical Analysis The script concatenates the Atlassian email address and Bitbucket API token into `AUTH`, then supplies the resulting credential to `curl` using the `-u` command-line option. Consequently, the credential may appear in the process argument vector while `curl` is running. On systems where process arguments are visible to other users, privileged monitoring agents, diagnostic tooling, or command telemetry, an observer may recover the complete Basic Authentication credential. Shell quoting prevents argument splitting but does not prevent exposure through process inspection. The documented recommendation to use a read-only token limits the possible damage, but it does not eliminate credential disclosure. The actual scope depends on the permissions assigned to the exposed token. ### Attack Path 1. An attacker obtains local process-inspection capability or access to telemetry that records process command lines. 2. A user invokes any CLI operation that calls `bb_get` or `bb_get_raw`. 3. The script launches `curl` with `-u "$ATLASSIAN_EMAIL:$BITBUCKET_API_TOKEN"`. 4. The attacker observes the `curl` pr ...[truncated 781 chars]
Remediation
View remediation

other

Warning
Location
bitbucket-cli.sh:151
Finding

Indirect Prompt Injection Through Untrusted Repository Files and Diffs

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description is partially accurate but incomplete. The code does browse Bitbucket Cloud repos, review pull requests, read diffs, and check branches, matching the stated core use case. However, it also provides several additional substantive capabilities not declared in the description: reading arbitrary file contents (file), listing directories and recursive trees (ls, tree), searching source code (search), reading commit history (commits, pr-commits), comparing refs (compare), and retrieving PR comments (comments). These are not just implementation details; they materially expand the skill from PR/diff/branch review into broader repository/code inspection and search. No write or destructive behavior is present, and resources remain within Bitbucket Cloud, but the declared description understates the actual scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill invokes a shell script and makes network requests to Bitbucket, but it does not declare an explicit tool scope such as allowed-tools or permissions. That increases the chance of unintended execution surface and weakens policy enforcement, because consumers of the skill must infer capabilities from prose rather than machine-readable restrictions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation guidance is broad enough that the skill may trigger on ordinary mentions of PRs, branches, repos, or Bitbucket, causing unnecessary access to repository data. In a system that auto-selects skills, this can lead to overuse of a credentialed integration and disclosure of private code or metadata when the user did not clearly intend repository inspection.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · bitbucket-cli.sh (reported line 21)May include surrounding context.

sh
done

AUTH="$ATLASSIAN_EMAIL:$BITBUCKET_API_TOKEN"
BASE="https://api.bitbucket.org/2.0"
WS="$BITBUCKET_WORKSPACE"

# --- HTTP helpers ---

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description limits the capability to PR, diff, and branch browsing, but the script also exposes arbitrary file reads (file, ls, tree) and workspace/repo code search (search). This is a scope expansion that can enable broader data access than a user or policy reviewer would reasonably expect, increasing the chance of unnecessary source disclosure across repositories.

Content

No source excerpt is available for this finding.