Back to skill

Security audit

Bark Notify

Security checks for vulnerabilities and agentic risk

Overview

This Bark notification skill is mostly coherent, but it needs review because it can send the Bark key and message content to arbitrary or unencrypted server URLs.

Review before installing. Use only a trusted HTTPS Bark server, avoid setting BARK_SERVER from untrusted environments, keep ~/.config private, and prefer manual creation of the config file with restrictive permissions. Do not use this with sensitive notification bodies unless you are comfortable with the configured Bark server receiving them.

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

Error
Location
scripts/bark-notify.py:191
Finding

Credentials and notification content can be transmitted over cleartext HTTP

Content
View full analysis
dict[str, Any]: payload: dict[str, Any] = { "device_key": key, "title": title, "body": " ".join(body), "group": group, } for name in ("sound", "icon", "url", "copy", "level", "badge"): value = getattr(args, name) if value is not None: payload[name] = value if "icon" not in payload and icon: payload["icon"] = icon return payload ``` ```python server = (args.server or os.environ.get("BARK_SERVER") or cfg.get("BARK_SERVER") or DEFAULT_SERVER).rstrip("/") ``` ```python result = request_json(f"{server}/push", payload) ``` ### Technical Analysis The Bark server can be selected through a command-line argument, an environment variable, or the local configuration file. The application does not parse or validate the selected URL before appending `/push` and transmitting the request. The request payload contains the Bark `device_key` as well as the notification title, body, group, and optional metadata. Although sending these values to a Bark server is necessary for the declared notification functionality, permitting an arbitrary `http://` destination exceeds the minimum secure network privileges needed for normal use. If a remote cleartext HTTP server is selected, TLS does not protect the request. A network-positioned attacker can observe or alter the payload. A maliciously modified environment or configuration can also redirect the payload to an attacker-controlled endpoint. ### Attack Path 1. An attacker influences `BARK_SERVER`, modifies the local configuration ...[truncated 1030 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/bark-notify.py:64
Finding

Bark key is written before restrictive file permissions are applied

Content
View full analysis
None: path.parent.mkdir(parents=True, exist_ok=True) content = "\n".join( [ "# Agent Bark Notify config", f"BARK_SERVER={quote_env_value(server.rstrip('/'))}", f"BARK_KEY={quote_env_value(key)}", f"BARK_GROUP={quote_env_value(group)}", "", ] ) path.write_text(content, encoding="utf-8") path.chmod(0o600) ``` ### Technical Analysis The configuration file contains the plaintext Bark device key. `Path.write_text()` creates or truncates the destination using permissions determined by the process umask. The code changes the file to mode `0600` only after the complete secret has been written. With a permissive umask, the file may therefore be readable by other local users during the interval between creation and `chmod()`. The operation also follows symbolic links and does not perform an atomic replacement. If an attacker can create or replace the destination in an inadequately protected configuration directory, the write and subsequent permission change can affect the symlink target. The documentation recommends mode `0700` for `~/.config`, but `save_config()` itself creates the parent directory without explicitly enforcing private permissions. ### Attack Path #### Temporary permission exposure 1. The user runs `--save-config` in an environment with a permissive umask. 2. `Path.write_text()` creates the file with permissions derived from that umask. 3. The plaintext `BARK_KEY` is written while those initial permissions remain active. 4. Another local user reads the file before `chmod(0o600)` completes. 5. The attacker reuses the key to send unauthorized Bark notifications. #### Symlink man ...[truncated 1014 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · .gitignore (reported line 12)May include surrounding context.

text
build/
*.egg-info/
.DS_Store
.env
bark-notify.env
bark-notify-agents.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Use this skill to send Bark notifications from an agent. The bundled script is `scripts/bark-notify.py`, resolved relative to this `SKILL.md`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
con` or agent icon is configured, use the built-in Agent Bark icon hosted from `assets/agent-bark.png` through jsDelivr. Resolution order is explicit `--icon`,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file contains prescriptive language instructions in Chinese, including a stylistic prohibition, while also using English for other instructions. This imposes a language/locale preference without any user opt-in or documented justification, which matches the language policy violation category.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

agent's own skills directory. Examples:

bash
mkdir -p ~/.codex/skills
ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 168)May include surrounding context.

  • Enable Critical Alerts if Bark shows that option and you intend to use critical.
  • Focus modes can still affect what appears immediately; allow Bark in the relevant Focus if needed.

If the user wants a shell command, they may optionally create a local wrapper:

bash
mkdir -p ~/.local/bin

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

如果只给一个 Agent 使用,请安装或链接到该 Agent 的技能目录。例如:

bash
mkdir -p ~/.codex/skills
ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.zh-CN.md (reported line 44)May include surrounding context.

如果只给一个 Agent 使用,请安装或链接到该 Agent 的技能目录。例如:

bash
mkdir -p ~/.codex/skills
ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.zh-CN.md (reported line 44)May include surrounding context.

如果只给一个 Agent 使用,请安装或链接到该 Agent 的技能目录。例如:

bash
mkdir -p ~/.codex/skills
ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 51)May include surrounding context.

mkdir -p ~/.codex/skills ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills ln -sf ~/.agents/skills/bark-notify ~/.claude/skills/bark-notify

text

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.zh-CN.md (reported line 47)May include surrounding context.

mkdir -p ~/.codex/skills ln -sf ~/.agents/skills/bark-notify ~/.codex/skills/bark-notify

mkdir -p ~/.claude/skills ln -sf ~/.agents/skills/bark-notify ~/.claude/skills/bark-notify

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.zh-CN.md (reported line 150)May include surrounding context.

如果需要 shell 命令,可选地创建本地包装器:

bash
mkdir -p ~/.local/bin
ln -sf ~/.agents/skills/bark-notify/scripts/bark-notify.py ~/.local/bin/bark-notify

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to use shell, network, environment, and local file operations, but it declares no explicit tool scope or permission boundaries. That omission increases the chance an agent can invoke broader capabilities than intended, making review, sandboxing, and policy enforcement weaker for a skill that handles secrets and sends network requests.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The skill advises storing the Bark device key in a persistent file under ~/.config/bark-notify.env. Even with restrictive file permissions, long-lived credential storage expands the attack window: any later local compromise, backup exposure, or accidental file access could reveal the key and allow unauthorized notifications.

Content

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

Configure

Create ~/.config/bark-notify.env manually when possible. It is private local configuration and the script saves it with mode 0600:

bash
mkdir -p ~/.config

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
mkdir -p ~/.config
chmod 700 ~/.config

To initialize it without putting the key in shell history, pass the key through standard input:

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 · tests/test_cli.py (reported line 175)May include surrounding context.

python
report = json.loads(output)
        self.assertEqual(rc, 0)
        self.assertEqual(calls, [("https://api.day.app/ping", None)])
        self.assertTrue(report["key_configured"])
        self.assertNotIn("secret-key", output)
        self.assertEqual(report["group"], {"value": "Codex", "source": "agent config"})

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file is a Chinese-language README variant, but it presents all skill usage instructions exclusively in Chinese and does not state that the user may choose their preferred language. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern unless the locale constraint is explicitly documented and justified.

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/bark-notify.py (reported line 119)May include surrounding context.

python
"group": group,
    }
    for name in ("sound", "icon", "url", "copy", "level", "badge"):
        value = getattr(args, name)
        if value is not None:
            payload[name] = value
    if "icon" not in payload and icon:

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
tests/test_cli.py:17