Back to skill

Security audit

Kan.bn TODO API

Security checks for vulnerabilities and agentic risk

Overview

This skill is broadly aligned with Kan.bn task management, but it can send stored credentials to any configured API server and perform deletions without clear confirmation safeguards.

Review this carefully before installing. Use it only with Kan.bn credentials you are comfortable letting an agent use for reads and writes, avoid custom KANBN_BASE_URL values unless you fully trust the endpoint, and require the agent to confirm exact targets before deleting cards, lists, comments, or checklist items.

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

Error
Location
scripts/kanbn_todo.py:54
Finding

Unvalidated API Base URL Enables Credential and Personal Data Exfiltration

Content
View full analysis

Vulnerability Details

File Location: scripts/kanbn_todo.py:54-91, scripts/kanbn_todo.py:117-129, and scripts/kanbn_todo.py:327-332
Vulnerability Type: Attacker-controlled network destination for authenticated requests
Risk Level: High

The client accepts an arbitrary API base URL from a command-line argument, environment variable, or ~/.bashrc. It then sends the configured bearer token or API key to that destination without validating the URL scheme or hostname.

Vulnerable Code

scripts/kanbn_todo.py:54-91:

python
class KanbnClient:
    def __init__(self, base_url, token=None, api_key=None, timeout=30):
        self.base_url = base_url.rstrip("/")
        self.token = token
        self.api_key = api_key
        self.timeout = timeout

    def request(self, method, path, params=None, body=None):
        query = ""
        if params:
            query = "?" + urllib.parse.urlencode(params, doseq=True)

        url = f"{self.base_url}{path}{query}"
        headers = {
            "Accept": "application/json",
        }
        # Some Kan.bn PUT endpoints require a JSON content-type even when the
        # request body is logically empty, so send an empty JSON object there.
        if body is not None:
            headers["Content-Type"] = "application/json"
            data = json.dumps(body).encode("utf-8")
        elif method.upper() in {"POST", "PUT", "PATCH"}:
            headers["Content-Type"] = "application/json"
            data = b"{}"
        else:
            data = None

        if self.token:
            headers["Authorization"] = f"Bearer {self.token}"
        if self.api_key:
            headers["x-api-key"] = self.api_key

        req = urllib.request.Request(url, data=data, headers=headers, method=method)

        try:
            with urllib.request.urlopen(req, timeout=self.timeout) as res:

scripts/kanbn_todo.py:117-129:

` ...[truncated 3381 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict the destination by default. Hard-code https://kan.bn/api/v1 when the Skill is intended exclusively for the official Kan.bn service.
  2. Validate any required custom endpoint. Parse the URL with urllib.parse.urlsplit and require:
    • The https scheme.
    • A hostname on an explicit allowlist.
    • An approved port.
    • No username or password component.
    • No fragment.
    • The expected API path.
  3. Require explicit user approval for custom deployments. Do not accept a custom endpoint solely from ambient configuration when credentials will be attached.
  4. Protect redirect handling. Disable automatic redirects or validate every redirect target before following it. Never forward authentication headers across origins.
  5. Remove the ~/.bashrc fallback. Shell startup files are an unnecessarily broad and mutable source for security-sensitive endpoint and credential configuration. Prefer process-scoped environment variables or a permission-restricted credential store.
  6. Discourage command-line credentials. Values passed through --token or --api-key may be exposed through process listings or shell history. Prefer environment variables, standard input, or an operating-system credential store.
  7. Fail closed. Reject invalid or unapproved destinations before constructing a request or loading authentication headers.
  8. Add security tests. Verify rejection of plaintext HTTP, unrelated domains, embedded credentials, unexpected ports, and cross-origin redirects.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior exceeds the declared scope: beyond simple personal TODO operations, the skill enumerates workspaces/boards, manages comments and checklists, and may read credentials from ~/.bashrc. This mismatch is dangerous because users and policy systems may trust the narrower description while the skill performs broader data access and mutation than expected.

Content

No source excerpt is available for this finding.

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 · references/api-scope.md (reported line 22)May include surrounding context.

md
- `PUT /cards/{cardPublicId}`
  - Updatable: `title`, `description`, `dueDate`, `listPublicId`, `index`
- Delete TODO
  - `DELETE /cards/{cardPublicId}`

## Status Changes

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 · references/api-scope.md (reported line 53)May include surrounding context.

md
- List management
  - `POST /lists`
  - `PUT /lists/{listPublicId}`
  - `DELETE /lists/{listPublicId}`
- Comments as personal notes
  - `POST /cards/{cardPublicId}/comments`
  - `PUT /cards/{cardPublicId}/comments/{commentPublicId}`

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 · references/api-scope.md (reported line 57)May include surrounding context.

md
- Comments as personal notes
  - `POST /cards/{cardPublicId}/comments`
  - `PUT /cards/{cardPublicId}/comments/{commentPublicId}`
  - `DELETE /cards/{cardPublicId}/comments/{commentPublicId}`
- Checklists for subtasks
  - `POST /cards/{cardPublicId}/checklists`
  - `POST /checklists/{checklistPublicId}/items`

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 · references/api-scope.md (reported line 62)May include surrounding context.

md
- `POST /cards/{cardPublicId}/checklists`
  - `POST /checklists/{checklistPublicId}/items`
  - `PATCH /checklists/items/{checklistItemPublicId}`
  - `DELETE /checklists/items/{checklistItemPublicId}`
- Personal profile
  - `GET /users/me`
  - `PUT /users`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope or permissions even though it is designed to use environment variables, read local files, and make authenticated network calls. This creates an authorization boundary problem: the runtime may allow broader access than users or reviewers expect, including reading secrets from the environment or ~/.bashrc and sending them to a remote API.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger text is broad enough to match common phrases like 'add a todo' or 'mark this P1' even when the user may not intend Kan.bn API actions. Over-broad invocation can cause the skill to activate in the wrong context, leading to unintended data discovery or mutation in a user's account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes deletion behavior with no documented confirmation or safeguard requirement. In a task-management context, unintended deletion can cause irreversible loss of user data, especially if broad triggers or fuzzy task resolution select the wrong card.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file documents a destructive endpoint for deleting TODO cards without any guardrails, confirmation requirements, or warning about irreversible data loss. In an agent skill, this omission increases the chance that a model could invoke deletion from ambiguous or prompt-injected instructions, causing unintended loss of user data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Several additional delete endpoints are listed for lists, comments, and checklist items with no warning about destructive effects or operator confirmation. Because this is an agent-facing API scope document, lack of safety guidance can lead to accidental bulk or targeted deletion of user content during normal automation flows.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script reads KANBN_TOKEN and KANBN_API_KEY directly from ~/.bashrc, expanding its capability from API use into local file access for secret discovery. In an agent skill, this is dangerous because it can silently harvest credentials from a sensitive shell initialization file without the user's explicit input for the current run, violating least privilege and widening the blast radius if the skill is misused or pointed at an attacker-controlled base URL.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Secret-loading from ~/.bashrc occurs silently, with no user-facing warning that a local shell config file may be read for tokens and API keys. In the context of an agent skill, undisclosed credential discovery undermines informed consent and makes unintended use of stored secrets more likely, especially for users who expect only direct API actions on their TODO data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill manifest describes single-user personal TODO management, but the implementation exposes broader workspace and board discovery/modification operations such as listing workspaces, reading arbitrary boards, and creating/updating board structures. This capability expansion increases the chance an agent can access or modify data beyond the narrow task-management scope the user reasonably expects, especially when combined with ambient credentials.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code supports comment and checklist creation, update, and deletion even though these capabilities are not disclosed in the manifest. While related to task management, hidden write capabilities are risky in an agent setting because they allow unexpected modification of richer task content than the advertised interface suggests.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/kanbn_todo.py (reported line 289)May include surrounding context.

python
def _must_have_updates(args, fields):
    if not any(getattr(args, f) is not None and getattr(args, f) != [] for f in fields):
        raise SystemExit("No fields to update. Provide at least one update argument.")

Static analysis

No suspicious patterns detected.