Back to skill

Security audit

Cookie Alive Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it stores and serves live login cookies in ways that could expose user accounts without enough safeguards.

Install only if you are comfortable treating this skill as a local credential store. Use it only with trusted sites and trusted local programs, avoid HTTP refresh URLs, avoid the HTTP wrapper unless you add authentication and keep it loopback-only, protect ~/.cookie_alive, and assume any printed cookie can be used to access the corresponding account.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cookie_alive.py:323
Finding

Session cookies are stored without restrictive filesystem permissions

Content
View full analysis
sqlite3.Connection: db_path.parent.mkdir(parents=True, exist_ok=True) conn = sqlite3.connect(db_path) conn.row_factory = sqlite3.Row conn.executescript(SCHEMA) return conn ``` The database schema stores reusable authentication material directly in the `cookie_json` column: ```python SCHEMA = """ CREATE TABLE IF NOT EXISTS sessions ( profile TEXT PRIMARY KEY, refresh_url TEXT NOT NULL, method TEXT NOT NULL, interval_seconds INTEGER NOT NULL, timeout_seconds INTEGER NOT NULL, cookie_json TEXT NOT NULL, headers_json TEXT NOT NULL, body TEXT, active INTEGER NOT NULL DEFAULT 1, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, last_refreshed_at TEXT, last_status_code INTEGER, last_error TEXT ); """ ``` ### Technical Analysis The application creates the cookie storage directory and SQLite database using process-default permissions. It does not explicitly set the directory to owner-only mode such as `0700` or the database to `0600`. The resulting permissions depend on the process umask and properties of any pre-existing storage directory. In an environment with permissive defaults, another local user or service account may be able to read the SQLite database. The database stores live session-cookie name/value pairs in plaintext, so possession of the file may be equivalent to possession of the associated authenticated sessions. The implementation also does not verify that the database path is not a symbolic link, that the file is owned by the current user, or that an existing file has safe permissions. ### Attack Path 1. A user creates or updates a profile containing an authenticated website session cookie. 2. `connect()` creates ...[truncated 897 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cookie_alive.py:211
Finding

Authenticated session cookies can be transmitted over cleartext HTTP

Content
View full analysis
str: parsed = parse.urlparse(raw_url) if parsed.scheme not in {"http", "https"} or not parsed.netloc: raise ValueError(f"refresh url must be a valid http/https URL: {raw_url}") return raw_url ``` The refresh operation then attaches the stored cookie to the accepted URL: ```python record = require_profile(conn, profile) headers = dict(record.headers) cookie_header = record.cookie_header() if cookie_header: headers["Cookie"] = cookie_header headers.setdefault("User-Agent", DEFAULT_USER_AGENT) body_bytes = record.body.encode("utf-8") if record.body is not None else None timeout_seconds = ensure_positive_int(timeout_override, "timeout_seconds") if timeout_override else record.timeout_seconds http_request = request.Request( record.refresh_url, data=body_bytes, headers=headers, method=record.method, ) ``` ### Technical Analysis Session cookies are bearer credentials: any party that obtains a valid cookie can frequently reuse it without knowing the account password. The URL validation explicitly accepts `http://`, and `refresh_profile()` unconditionally adds the stored cookie to the outgoing request. When HTTP is used, the cookie and request metadata are not protected by transport encryption or server authentication. A passive observer on the same network can capture the cookie, while an active intermediary can read or modify requests and responses. An active attacker may also inject `Set-Cookie` responses, which the application subsequently merges into its persistent database. The risk can arise from user error, unsafe documentation supplied by another integration, or a profile configured ...[truncated 1046 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/examples/http_api_wrapper.py:91
Finding

Unauthenticated HTTP endpoints expose reusable session credentials

Content
View full analysis
None: parsed = parse.urlparse(self.path) route = parsed.path.rstrip("/") or "/" query = parse.parse_qs(parsed.query) try: if route == "/": self.respond_json( 200, { "service": "cookie_alive_http_wrapper", "routes": ["/health", "/pull", "/check", "/list"], }, ) return if route == "/health": self.respond_json(200, {"ok": True}) return if route == "/pull": self.handle_pull(query) return if route == "/check": self.handle_check(query) return if route == "/list": self.handle_list(query) return self.respond_json(404, {"error": f"unknown route: {route}"}) except Exception as exc: self.respond_json(500, {"error": str(exc)}) ``` The caller controls the database, profile, output format, and whether a refresh occurs: ```python def handle_pull(self, query: dict[str, list[str]]) -> None: db_name = first_value(query, "db_name", self.config.db_name) or self.config.db_name profile = first_value(query, "profile", self.config.profile) output_format = first_value(query, "format", "header") or "header" refresh = parse_bool(first_value(query, "refresh"), default=False) timeout_seconds = first_value(query, "timeout_seconds") if not profile: self.respond_json(400, {"error": "missing profile"}) return comma ...[truncated 4449 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/commands.md:15
Finding

Session credentials are exposed through command-line arguments and standard output

Content
View full analysis
int: record = upsert_profile( db_path=resolve_db_path(args.db_name), profile=args.profile, refresh_url=args.refresh_url, method=args.method, interval_seconds=args.interval_seconds, timeout_seconds=args.timeout_seconds, cookies=read_cookie_source(args), headers=read_headers(args), body=args.body, active=not args.inactive, ) print_json(record.to_dict()) return 0 ``` The integration examples print retrieved cookie values: ```python print("cookie_alive stdout:") print(cookie_output) ``` ```python print("cookie_alive output:") print(cookie_output) ``` ### Technical Analysis Command-line arguments may be retained in shell history and can be exposed through process inspection, diagnostic tooling, audit systems, job metadata, or terminal recording. Supplying a live cookie through `--cookie-header` or `--cookie-json` therefore places a reusable bearer credential in channels not intended for secret handling. The CLI's complete record format contains both ` ...[truncated 1460 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/cookie_alive.py`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill performs sensitive operations across filesystem, shell, environment, and network boundaries but does not declare any tool scope or permissions. In this context, the skill manages authenticated session cookies and can persist and replay them, so the absence of explicit scope meaningfully increases the chance of overbroad access, unintended execution contexts, or misuse by downstream agents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description says the skill persists, refreshes, and serves cookies, but it does not clearly warn that these are authenticated session tokens stored on disk and exposed to other programs. Because session cookies can grant account access equivalent to a logged-in user, understated disclosure raises the risk that users or agents invoke the skill without understanding the credential-handling and exfiltration implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly encourages printing live authenticated cookies to stdout, passing them between programs, and exposing them through a local HTTP wrapper without any warning that these values are bearer credentials. In practice, cookies can be captured via shell history, process inspection, terminal scrollback, logs, or access to the local service, enabling session hijacking and account takeover for the associated website.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The record serialization includes raw cookies and a rendered Cookie header, and multiple command handlers print that data directly to stdout. In CLI, agent, or pipeline contexts, stdout is commonly logged, captured, or forwarded, so this can leak reusable session tokens to logs, other tools, or less-privileged observers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code sends stored session cookies to whatever refresh URL a profile contains, with only minimal scheme validation and no allowlist, origin binding, or user-facing confirmation at the moment of transmission. In a skill specifically designed to persist authenticated cookies and hand them to other programs, that behavior can exfiltrate live session credentials to attacker-controlled endpoints if a profile or URL is maliciously supplied or modified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The HTTP wrapper exposes endpoints that return live cookies and query the cookie store with no authentication, authorization, or origin restriction beyond whatever host the operator chooses at startup. In the context of a skill whose purpose is to persist and serve authenticated session cookies, exposing /pull over HTTP materially increases the chance of session-token theft or misuse by any local or network-accessible process.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

HTTP requests to /pull, /check, and /list directly trigger subprocess execution and, in the case of /pull, can refresh and return session cookies without any user-facing warning, consent step, or access control. In a cookie-management skill, silently allowing HTTP-triggered retrieval of authenticated material makes abuse by local malware, adjacent services, or accidental exposure more dangerous.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Starting a persistent threaded HTTP server expands the attack surface from local helper logic into a continuously reachable service. Because this skill handles authenticated cookies, any long-lived listener that can be misbound, proxied, or reached by other local users/processes increases the risk of unauthorized cookie retrieval and operational abuse.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/examples/http_api_wrapper.py (reported line 65)May include surrounding context.

python
refresh=refresh,
        output_format=output_format,
    )
    result = subprocess.run(
        command,
        text=True,
        capture_output=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/examples/other_program_calls_cookie_alive.py (reported line 65)May include surrounding context.

python
refresh=refresh,
        output_format=output_format,
    )
    result = subprocess.run(
        command,
        text=True,
        capture_output=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script prints the live session cookie value directly to stdout, which can expose authentication material to terminal history, logs, CI output, shell capture, or other local observers. Because this skill is explicitly designed to persist and serve authenticated cookies, leaking the cookie effectively leaks the user's authenticated session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script automatically reuses the session cookie in an outbound HTTP request, which can disclose valid authentication state to a remote endpoint if the URL is changed, misconfigured, or attacker-controlled. In the context of a cookie-management skill, forwarding cookies is core functionality, but doing so without stronger safeguards increases the chance of credential leakage or misuse.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/examples/use_chsi_cookie.py (reported line 42)May include surrounding context.

python
]
    if refresh:
        command.append("--refresh")
    return subprocess.check_output(command, text=True, stderr=subprocess.PIPE).strip()


def fetch_page(url: str, cookie_header: str, referer: str, user_agent: str, timeout_seconds: int) -> dict[str, object]:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints the retrieved session cookie material directly to stdout before using it. Because this skill is specifically designed to persist and serve authenticated cookies, exposing them in terminal output, logs, CI captures, shell history workflows, or calling agents can leak reusable session credentials and enable account/session hijacking.

Content

No source excerpt is available for this finding.