Back to skill

Security audit

boka-tvattid

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but it handles real PIN-backed booking actions and has an under-disclosed debug mode that can print account tokens or booking data to logs.

Install only if you are comfortable giving the skill your Boka tvättid building, apartment number, and PIN so it can perform real bookings and cancellations. Keep BOKA_DEBUG unset, prefer environment or config over command-line PINs, and review each proposed booking or cancellation before allowing it to proceed.

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/bokatvattid.py:45
Finding

Debug Mode Logs Unredacted Authentication Tokens and Account Data

Content
View full analysis

Vulnerability Details

File Location: scripts/bokatvattid.py, lines 45–46 and 58–59
Vulnerability Type: Sensitive information exposure through diagnostic logging
Risk Level: Medium

Vulnerable code in _get:

python
if os.environ.get("BOKA_DEBUG"):
    print(json.dumps(d, ensure_ascii=False)[:2000], file=sys.stderr)

Vulnerable code in _post:

python
if os.environ.get("BOKA_DEBUG"):
    print(json.dumps(d, ensure_ascii=False)[:2000], file=sys.stderr)

Technical Analysis

The _get and _post functions serialize API responses without redaction and write up to 2,000 characters to standard error whenever the inherited BOKA_DEBUG environment variable is set.

This includes the response to the checkLogin2 authentication request. The project API reference documents that this response contains an authentication Token and ApartmentID. Other API responses may contain user identifiers, apartment-related information, room details, and current booking records.

Truncating the serialized response does not provide effective protection because authentication tokens and identifiers may occur near the beginning of the response. Standard error is also commonly captured by agent runtimes, CI systems, terminal recording, centralized logging, and diagnostic reports.

The network transmission itself is necessary for the declared remote booking functionality and is restricted to fixed HTTPS service endpoints. The vulnerability is the unnecessary secondary disclosure of returned sensitive data through logs.

Attack Path

  1. A user, parent process, CI configuration, or agent execution environment sets BOKA_DEBUG to any non-empty value.
  2. The CLI performs the normal login operation using the user's building ID, apartment number, and PIN.
  3. The remote service returns a response containing an authentication token and account identifier.
  4. _post serializes the complete response with ...[truncated 1094 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove complete response-body logging from both _get and _post.
  2. If diagnostic logging is required, log only non-sensitive metadata such as the request method, destination host, HTTP status, API error code, response size, and elapsed time.
  3. Apply recursive redaction before serializing any structured response. At minimum, redact keys such as Token, token, pincode, PIN, ApartmentID, apartmentID, userid, and fields containing booking or resident information.
  4. Use an allowlist of fields safe to log rather than relying only on a denylist.
  5. Replace activation through an arbitrary inherited environment variable with an explicit diagnostic option and display a warning when sensitive operations are performed in debug mode.
  6. Ensure test, CI, agent, and production environments do not enable BOKA_DEBUG by default.
  7. Review existing logs for exposed tokens or account data, restrict log access, securely delete unnecessary copies, and invalidate affected sessions where feasible.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill appears to require access to environment variables and network resources, but it does not declare any explicit tool scope or permissions boundary. That makes the runtime trust model unclear and can lead to over-broad access, especially because the skill handles sensitive credentials (PIN) and performs real account actions against an external service.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger list contains broad everyday terms like 'tvättid' and 'tvättstuga', which can cause the skill to activate in ordinary conversation even when the user did not intend to perform a booking action. In this context, accidental invocation is more dangerous than usual because the skill can access sensitive PIN-backed account operations and perform real bookings or cancellations.

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

md
import argparse, datetime, json, os, re, sys, urllib.parse, urllib.request

LEGACY = "https://prod.bokatvattid.se/api/api2"
V2 = "https://api.visirsolutions.com/api/v2"
CFG_DIR = os.path.expanduser("~/.config/bokatvattid")

class BokaError(Exception):

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

md
import argparse, datetime, json, os, re, sys, urllib.parse, urllib.request

LEGACY = "https://prod.bokatvattid.se/api/api2"
V2 = "https://api.visirsolutions.com/api/v2"
CFG_DIR = os.path.expanduser("~/.config/bokatvattid")

class BokaError(Exception):

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 · scripts/bokatvattid.py (reported line 21)May include surrounding context.

python
import argparse, datetime, json, os, re, sys, urllib.parse, urllib.request

LEGACY = "https://prod.bokatvattid.se/api/api2"
V2 = "https://api.visirsolutions.com/api/v2"
CFG_DIR = os.path.expanduser("~/.config/bokatvattid")

class BokaError(Exception):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The API request payload sets lang to "1" unconditionally, and the rest of the CLI prompts/messages are also written in Swedish. This forces a specific language/locale without user opt-in or documented justification, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.