Back to skill

Security audit

Bark Push

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Bark notification helper, but it needs review because it can send user content to a third-party service and has avoidable credential-handling and shell payload-safety issues.

Review this before installing if you will use it from automated workflows or with sensitive task data. Prefer explicit user confirmation before each send, do not put secrets or private records in notification text, avoid printing or passing the Bark key on the command line, and prefer the Node implementation or a JSON-safe shell rewrite for untrusted notification content.

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
scripts/bark-send.sh:108
Finding
Bark Device Key Exposed Through Command-Line Arguments and Troubleshooting Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bark-send.sh:54-57, 108, 163-170`; additional unsafe guidance at `SKILL.md:176` **Vulnerability Type**: Sensitive credential exposure **Risk Level**: Medium ### Vulnerable Code ```bash -k|--key) DEVICE_KEY="$2" shift 2 ;; ``` ```bash # Build request URL API_URL="https://api.day.app/${DEVICE_KEY}" ``` ```bash # Send request RESPONSE=$(curl -s -X POST "$FULL_URL" \ -H 'Content-Type: application/json' \ -d "$JSON_PAYLOAD" 2>&1) ``` The documentation also recommends printing the credential directly: ```bash 1. 检查 BARK_KEY 是否正确: `echo $BARK_KEY` ``` ### Technical Analysis The Bark device key acts as an authorization credential because anyone possessing it can submit push notifications for the associated Bark device. The shell implementation places this key inside `FULL_URL`, which is passed to `curl` as a command-line argument. While `curl` is running, local users or monitoring software with sufficient process visibility may be able to inspect the URL through process listings, process telemetry, shell tracing, audit logs, or debugging tools. Supplying the key through `-k` creates an additional exposure because the key is already present in the shell script's own process arguments. The troubleshooting documentation compounds the issue by recommending `echo $BARK_KEY`, which can disclose the key through terminal recording, shell-session capture, CI logs, support transcripts, or screen sharing. The request uses HTTPS, so this finding does not imply that the key is transmitted in plaintext over the network. The exposure occurs locally and in operational logs. ### Attack Path 1. A user invokes the shell script with `BARK_KEY` configured or supplies the key through `-k`. 2. The script embeds the key in `https://api.day.app/${DEVICE_KEY}`. 3. The complete URL is passed as an argument to the `curl` process. 4. A local observer, process-monitoring agent, or log collector captures ...[truncated 829 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not recommend printing the complete key. Replace the troubleshooting instruction with a presence check or masked diagnostic, for example: ```bash if [[ -n "${BARK_KEY:-}" ]]; then printf 'BARK_KEY is configured: %.4s...%s\n' \ "$BARK_KEY" "${BARK_KEY: -4}" else echo 'BARK_KEY is not configured' fi ``` 2. Discourage passing the key through `-k`, because command-line arguments are commonly observable. Prefer a protected environment variable, restricted configuration file, standard-input mechanism, or operating-system secret store. 3. Prefer an HTTPS client implementation in which the secret URL path is constructed inside the process rather than supplied to an external executable as an argument. The existing Node implementation avoids passing the API URL to a child process, although its `-k` option should still be deprecated for the same command-line exposure reason. 4. If the shell implementation must remain, clearly document the local process-visibility risk and ensure execution environments restrict process inspection and command logging. 5. Redact Bark keys from application logs, traces, error reports, telemetry, CI output, and support bundles. 6. Rotate the Bark device key if it has previously been printed, logged, or used through command-line arguments in an untrusted multi-user environment. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/bark-send.sh:140
Finding
Unsafe JSON Construction Allows Payload Field Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bark-send.sh:140-151` **Vulnerability Type**: Improper escaping and injection into a structured JSON payload **Risk Level**: Medium ### Vulnerable Code ```bash # Send notification using POST with JSON JSON_PAYLOAD=$(cat <<EOF { "title": "$TITLE", "body": "$BODY"$(if [[ -n "$SUBTITLE" ]]; then echo ", \"subtitle\": \"$SUBTITLE\""; fi)$(if [[ -n "$SOUND" ]]; then echo ", \"sound\": \"$SOUND\""; fi)$(if [[ -n "$BADGE" ]]; then echo ", \"badge\": $BADGE"; fi)$(if [[ -n "$URL" ]]; then echo ", \"url\": \"$URL\""; fi)$(if [[ -n "$GROUP" ]]; then echo ", \"group\": \"$GROUP\""; fi)$(if [[ -n "$LEVEL" ]]; then echo ", \"level\": \"$LEVEL\""; fi)$(if [[ -n "$IMAGE" ]]; then echo ", \"image\": \"$IMAGE\""; fi) } EOF ) ``` ### Technical Analysis All notification fields are inserted directly into a JSON template without JSON-aware escaping. Characters such as double quotes, backslashes, newlines, and control characters can therefore terminate the intended string or make the document invalid. For example, a crafted title can close the `title` string and introduce another property: ```text x", "url": "https://attacker.example/phish", "injected": "y ``` The beginning of the generated payload would become structurally similar to: ```json { "title": "x", "url": "https://attacker.example/phish", "injected": "y", "body": "..." } ``` Depending on duplicate-property handling and which legitimate options are present, an attacker may inject or override Bark-supported fields such as `url`, `image`, `level`, `group`, `sound`, or `badge`. Less carefully crafted input will produce malformed JSON and cause notification delivery to fail, creating a denial-of-service condition for notifications containing ordinary quotation marks, backslashes, or multiline content. The `badge` value is also inserted as an unquoted JSON token without numeric validation. This provides another path to corrupt or reshape t ...[truncated 1707 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace manual JSON interpolation with a JSON-aware serializer. Since the script already assumes `jq` is available, construct the payload with `jq -n` and pass every string through `--arg`. 2. Validate typed and enumerated fields before serialization: - Require `badge` to match an explicitly permitted integer range. - Restrict `level` to `passive`, `active`, `timeSensitive`, or `critical`. - Validate `sound` against supported sound identifiers if arbitrary values are unnecessary. - Permit only expected URL schemes, preferably `https`, for `url` and `image`. - Apply reasonable length limits to all user-controlled strings. 3. A safe construction pattern is: ```bash if [[ -n "$BADGE" && ! "$BADGE" =~ ^[0-9]+$ ]]; then echo "Error: Badge must be a non-negative integer" >&2 exit 1 fi JSON_PAYLOAD=$( jq -n \ --arg title "$TITLE" \ --arg body "$BODY" \ --arg subtitle "$SUBTITLE" \ --arg sound "$SOUND" \ --arg url "$URL" \ --arg group "$GROUP" \ --arg level "$LEVEL" \ --arg image "$IMAGE" \ --arg badge "$BADGE" \ '{ title: $title, body: $body } + (if $subtitle != "" then {subtitle: $subtitle} else {} end) + (if $sound != "" then {sound: $sound} else {} end) + (if $badge != "" then {badge: ($badge | tonumber)} else {} end) + (if $url != "" then {url: $url} else {} end) + (if $group != "" then {group: $group} else {} end) + (if $level != "" then {level: $level} else {} end) + (if $image != "" then {image: $image} else {} end)' ) ``` 4. Remove the separately assembled `QUERY_PARAMS` unless it is required. It duplicates fields already present in the JSON body and is also assembled without URL encoding. 5. Add regression tests covering quotation marks, backslashes, Unicode, multiline content, empty optional values, invalid badge values, and ...[truncated 33 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (15)

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill documents use of environment variables and shell commands but does not declare any tool scope or allowed-tools boundary. In an agent environment, missing explicit permissions can cause the skill to be invoked with broader-than-intended capabilities, increasing the chance of unauthorized shell execution or secret access.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad and map to common language like 'send a notification' or 'push to phone,' which makes accidental or overly permissive invocation more likely. In an agent setting, that can cause unintended transmission of user content to the external Bark service without a sufficiently specific user request.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The documentation instructs sending notification content to the Bark API but does not clearly warn that titles, bodies, URLs, and related metadata will leave the local environment and be transmitted to a third party. This creates a real risk of users or downstream agents exfiltrating sensitive information without informed consent.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. 环境变量配置

Bark API endpoint: `https://api.day.app/{device_key}`

Device key 可以从以下环境变量读取 (按优先级):
1. `BARK_KEY`
Confidence
96% confidence
Finding
Referencing the Bark API endpoint establishes that the skill depends on an external network service and will transmit data outside the local trust boundary. In this context, the danger is not the endpoint string itself but the undocumented data flow and potential for sensitive notification content to be sent externally.

External Transmission

Medium
Category
Data Exfiltration
Content
-t "提醒" -b "时间到了" -s alarm
```

### 方式三:直接使用 curl

```bash
# 简单推送
Confidence
98% confidence
Finding
This section explicitly shows using curl to send notification payloads to the external Bark endpoint, meaning arbitrary message content can be transmitted off-system. In the context of an agent skill, that is a genuine data-exfiltration channel if user data, secrets, or task outputs are inserted into the notification body.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# 简单推送
curl "https://api.day.app/$BARK_KEY/标题/内容"

# 带参数
curl -X POST "https://api.day.app/$BARK_KEY" \
Confidence
98% confidence
Finding
The example curl command embeds the device key in a URL and sends content directly to Bark, creating a straightforward outbound channel. Besides external transmission, placing secrets in command lines and URLs can expose them through shell history, logs, or process listings in some environments.

External Transmission

Medium
Category
Data Exfiltration
Content
curl "https://api.day.app/$BARK_KEY/标题/内容"

# 带参数
curl -X POST "https://api.day.app/$BARK_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "标题",
Confidence
98% confidence
Finding
The POST example sends structured notification data, including title, body, and metadata, to a third-party API over the network. This is a valid skill function, but without explicit guardrails it becomes a convenient exfiltration path for sensitive task data in an agent workflow.

External Transmission

Medium
Category
Data Exfiltration
Content
if (options.image) payload.image = options.image;

// Build API URL
const apiUrl = new URL(`https://api.day.app/${options.key}`);

// Send request
const postData = JSON.stringify(payload);
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
fi

# Build request URL
API_URL="https://api.day.app/${DEVICE_KEY}"

# Build query string
QUERY_PARAMS=""
Confidence
87% confidence
Finding
The hardcoded remote endpoint shows that the skill is designed to send data to api.day.app, an external service outside the local trust boundary. While expected for push notifications, this is still security-relevant because an agent can use the skill to export potentially sensitive information to a user-controlled device or third-party infrastructure.

External Transmission

Medium
Category
Data Exfiltration
Content
fi

# Send request
RESPONSE=$(curl -s -X POST "$FULL_URL" \
    -H 'Content-Type: application/json' \
    -d "$JSON_PAYLOAD" 2>&1)
Confidence
89% confidence
Finding
The script transmits user-supplied title, body, URL, image, group, subtitle, and the device key to an external third-party service via curl. In the context of an agent skill, this creates an exfiltration channel: sensitive prompts, secrets, or internal data could be pushed off-system to a remote iPhone without strong validation, consent, or content restrictions.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
Large parts of the operational instructions are written in Chinese, while the top-level metadata and description are in English. This creates a language-policy issue because the skill effectively assumes a specific language without telling the user or offering an alternative.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
This code file contains user-facing natural-language strings such as "Click跳转URL" and example titles/bodies entirely in Chinese, but it does not indicate that the skill is region-specific or offer an alternate language/localization choice. That can conflict with language/locale policy expectations for general-purpose skills.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The help text mixes English with Chinese-only user-facing examples such as "Click跳转URL", "标题", "内容", and "提醒". This creates a natural-language locale bias in the skill's interface and documentation without stating that the tool is intended only for Chinese-speaking users or offering an opt-in language choice.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"send": "node bark-send.js"
  },
  "dependencies": {
    "axios": "^1.6.0"
  }
}
Confidence
95% confidence
Finding
The dependency is specified with a caret range (`^1.6.0`), which allows installation of newer minor/patch releases without explicit review or lockstep control. In a security-sensitive automation skill that sends outbound network requests, this weakens supply-chain reproducibility and can silently introduce vulnerable or malicious dependency updates.

Unverifiable Dependency: axios has 16 known advisory(ies) (CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
79% confidence
Finding
`axios` has multiple known advisories, and because the manifest uses a version range rather than an exact reviewed release, it is not possible to verify from this file alone whether the installed version is affected. In this skill, axios is likely used to send push notifications over the network, so dependency flaws could affect request integrity, proxy handling, or SSRF-related behavior depending on how the library is used elsewhere.

Static analysis

No suspicious patterns detected.