Back to skill

Security audit

rn-bundle-to-github

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent GitHub release purpose, but it tells users to run an unverified remote shell script with repository credentials and publishing authority.

Review this skill carefully before installing. Only use it with a fine-grained GitHub token limited to the target repository, inspect or vendor the publish.sh script before running it, prefer a pinned commit plus checksum, and understand that running the workflow can change package.json, CHANGELOG.md, commits, tags, remote branches, and GitHub Releases.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:55
Finding
Unverified Remote Shell Script Retrieved from a Mutable Branch and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 55–74 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash # Download the release script curl -o publish.sh https://raw.githubusercontent.com/lvtong199881/MyRNApp/refs/heads/main/publish.sh chmod +x publish.sh # Add npm scripts (optional) npm pkg set scripts.release="bash publish.sh" npm pkg set scripts.debug="bash publish.sh debug" ``` The downloaded script is subsequently executed as follows: ```bash # Publish a release version npm run release # Or execute directly ./publish.sh # Publish a debug version npm run debug # Or execute directly ./publish.sh debug ``` ### Technical Analysis The Skill instructs users to retrieve a shell script from a personal GitHub repository's mutable `main` branch and execute it locally. The remote resource is not pinned to an immutable commit, and no cryptographic checksum, digital signature, or trusted release artifact verification is performed. Consequently, the code reviewed during this audit is not necessarily the code that a future user will execute. The repository owner—or an attacker who compromises the repository, GitHub account, branch, or delivery path—can replace `publish.sh` after the Skill has been reviewed. The remote script is not included in the audited project, so its implementation and effective permissions cannot be verified. According to the documented workflow, it operates in a React Native repository and may have access to: - The user's source code and working tree. - Local Git credentials and repository remotes. - The GitHub token stored at `~/.github_token`. - Package files, generated bundles, changelogs, commits, and tags. - Network access used to push changes and create GitHub releases. Downloading arbitrary executable code from a mutable personal repository exceeds the minimum privilege and trust required for the declared release workflow. A reviewed script bundle ...[truncated 1785 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Include the complete, reviewed `publish.sh` implementation inside the Skill package rather than downloading executable code at runtime. 2. If remote retrieval is unavoidable, pin the URL to a specific immutable Git commit instead of `refs/heads/main`. 3. Publish and document a trusted SHA-256 digest, then verify it before execution and fail closed on any mismatch. For example: ```bash curl --fail --show-error --location \ --output publish.sh \ "https://raw.githubusercontent.com/lvtong199881/MyRNApp/<immutable-commit>/publish.sh" echo "<trusted-sha256> publish.sh" | sha256sum --check - bash publish.sh ``` 4. Prefer signed release artifacts and verify the maintainer's cryptographic signature against a separately established trusted key. 5. Review the script locally before execution and expose its source as part of the audited Skill. 6. Use a fine-grained GitHub token restricted to the specific target repository and only the permissions needed to create releases and upload assets. 7. Avoid broadly scoped classic Personal Access Tokens. Use short-lived credentials where supported and revoke or rotate them after suspected exposure. 8. Prevent the release script from reading unrelated files or credentials, and run it in an isolated CI job or restricted container with access only to the required project files. 9. Configure branch protection, mandatory review, signed commits, and restricted write access for the repository hosting any release automation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Credential Access

High
Category
Privilege Escalation
Content
1. Node.js >= 18
2. GitHub 账号和仓库
3. GitHub Personal Access Token

### Step 1: 配置 GitHub Token
Confidence
84% confidence
Finding
The workflow requires a GitHub Personal Access Token and stores it in a plaintext file under the user's home directory. While credential use is expected for publishing releases, this storage pattern increases exposure risk if the host is compromised, backups are leaked, or users overprovision the token with broad repo access.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 创建 token 文件(只读权限即可)
echo "ghp_xxxxxxxxxxxx" > ~/.github_token
chmod 600 ~/.github_token
```

Token 需要 `repo` 权限才能创建 Release 和上传 assets。
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill instructs users to download and execute a shell script directly from a remote GitHub URL without any integrity verification, review guidance, or safety warning. Because the script is fetched from a mutable branch reference, the content could change and execute arbitrary commands in the user's project environment.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The documented release flow performs state-changing actions such as updating package.json and CHANGELOG.md, committing, pushing, tagging, and creating a GitHub Release, but it does not prominently warn that these actions happen automatically. A user may trigger the workflow without realizing it will mutate local and remote repository state and publish artifacts externally.

External Transmission

Medium
Category
Data Exfiltration
Content
通过 GitHub API 创建:

```bash
POST https://api.github.com/repos/{owner}/{repo}/releases
```

Release 包含:
Confidence
50% 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
通过 GitHub API 创建:

```bash
POST https://api.github.com/repos/{owner}/{repo}/releases
```

Release 包含:
Confidence
50% 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
通过 GitHub API 创建:

```bash
POST https://api.github.com/repos/{owner}/{repo}/releases
```

Release 包含:
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The instructions are internally inconsistent: they say a token file can use 'read-only' permissions/expectations, but the workflow later requires a token with write-capable repo scope to create releases and upload assets. This can mislead users into mishandling credential scope and security assumptions around a highly privileged GitHub token.

Static analysis

No suspicious patterns detected.