Back to skill

Security audit

Web Deploy GitHub Pages

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for publishing static sites, but it can overwrite local files and publicly push broad project contents to GitHub without strong confirmation or scoping.

Install only if you are comfortable with a skill that can create public GitHub repositories and publish site contents. Before running its scripts, use a new empty project directory, review every file that will be committed, add a conservative .gitignore, avoid secrets or private documents in the project tree, and require explicit approval before public repo creation, pushes, and GitHub Pages activation.

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/init_project.sh:5
Finding

Unrestricted Project Path Allows Overwriting Existing Files

Content
View full analysis

Vulnerability Details

File Location: scripts/init_project.sh, lines 5-16 and subsequent file writes at lines 21-140
Vulnerability Type: Unvalidated filesystem path and destructive file overwrite
Risk Level: Medium

Vulnerable Code

bash
PROJECT_NAME=$1

if [ -z "$PROJECT_NAME" ]; then
    echo "Usage: bash init_project.sh <project-name>"
    exit 1
fi

echo "🚀 Initializing project: $PROJECT_NAME"

# Create project directory
mkdir -p "$PROJECT_NAME"
cd "$PROJECT_NAME"

# Create basic structure
mkdir -p .github/workflows

# Create index.html
cat > index.html <<'EOF'

The same unconditional redirection pattern is subsequently used for styles.css, script.js, README.md, and .github/workflows/deploy.yml.

Technical Analysis

The script accepts PROJECT_NAME as an arbitrary path. Although the variable is quoted, which prevents shell word splitting and ordinary command injection, it is not validated as a project name or constrained to an approved workspace.

Values such as ., .., an absolute path, or a path to an existing project are accepted by mkdir -p and cd. The script then uses truncating output redirection (>) to replace predictable files without checking whether the destination is new or whether those files already exist.

This violates safe filesystem-boundary and fail-safe overwrite principles. The vulnerability is limited by the operating-system permissions of the user running the script; it does not independently provide privilege escalation.

Attack Path

  1. An attacker persuades the user or Agent to use a crafted “project name,” such as ., ../existing-project, or an absolute writable path.
  2. The documented initialization command is executed with that value.
  3. mkdir -p succeeds because the target already exists or can be created.
  4. cd changes into the attacker-selected destination.
  5. The script silently truncates a ...[truncated 635 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate project names against a restrictive allowlist, for example:

    bash
    if [[ ! "$PROJECT_NAME" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then
        echo "Invalid project name" >&2
        exit 1
    fi
    
  2. Reject absolute paths, path separators, . and ...

  3. Resolve the canonical destination and verify that it remains beneath an explicitly approved workspace directory.

  4. Abort if the destination already exists and is non-empty unless the user gives explicit overwrite confirmation.

  5. Create the project atomically with plain mkdir rather than mkdir -p, so existing destinations cause failure.

  6. Use non-clobbering writes or temporary files followed by atomic renames.

  7. Run the script as an unprivileged account and never with sudo.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/deploy_github_pages.sh:28
Finding

Recursive Git Staging Can Publish Unintended Sensitive Files

Content
View full analysis

Vulnerability Details

File Location: scripts/deploy_github_pages.sh, lines 28-42
Vulnerability Type: Unvalidated deployment directory and indiscriminate public repository publication
Risk Level: Medium

Vulnerable Code

bash
cd "$PROJECT_NAME"

# Initialize git if not already
if [ ! -d .git ]; then
    echo "📦 Initializing git repository..."
    git init
    git add .
    git commit -m "Initial commit"
fi

# Create GitHub repository
echo "📦 Creating GitHub repository..."
if gh repo create "$PROJECT_NAME" --public --source=. --remote=origin --push 2>/dev/null; then
    echo "✅ Repository created and pushed"

Technical Analysis

The deployment script accepts an arbitrary reachable directory through PROJECT_NAME, enters it without canonical-path validation, and recursively stages all content using git add .. It then explicitly creates and pushes to a public GitHub repository.

No allowlist limits the staged content to expected static-site files. The script also does not verify a .gitignore, scan the staged set for credentials, detect environment files, or request confirmation before making the repository public.

Quoting the path prevents shell injection but does not prevent selection of the wrong directory. As a result, unrelated or sensitive files located under the selected directory can be committed and publicly disclosed.

Attack Path

  1. A deployment directory contains sensitive material such as .env files, API keys, private documents, configuration backups, or unrelated source files.
  2. An attacker supplies or induces use of that directory as PROJECT_NAME, or the user mistakenly selects it.
  3. If the directory is not already a repository, git init creates one there.
  4. git add . recursively stages all non-ignored content.
  5. git commit records the sensitive material in Git history.
  6. gh repo create --public --source=. --push creates a public r ...[truncated 702 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate and canonicalize the deployment path, ensuring it resides beneath an approved projects workspace.
  2. Require the target to contain an expected project marker or manifest before deployment.
  3. Generate and validate a conservative .gitignore covering at least:
    • .env and .env.*
    • private keys and certificates
    • credential files
    • editor and operating-system metadata
    • build caches and backup files
  4. Stage only expected deployment assets instead of using an unrestricted git add ..
  5. Inspect git diff --cached --name-only and scan staged files for secrets before committing.
  6. Display the complete staged-file list and require explicit confirmation before creating a public repository.
  7. Default to a private repository unless public access is expressly requested.
  8. If accidental publication occurs, revoke exposed credentials immediately and purge sensitive objects from Git history; a normal deletion commit is insufficient.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description describes a full autonomous static-site creation and deployment system for GitHub Pages. The supplied code chunk does not implement any of those capabilities; it is only a minimal frontend JavaScript file that prints a message to the console. This is a material mismatch in primary purpose and functionality, not merely an omitted implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises an end-to-end workflow for creating and deploying static sites to GitHub Pages. However, the provided code chunk only contains browser-side UI enhancements for a landing page template. It does not create repositories, initialize projects, configure or invoke GitHub Pages, define GitHub Actions, or perform any deployment-related tasks. This is a materially different primary purpose from the declared autonomous build-and-deploy functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description emphasizes an end-to-end workflow for creating and deploying static websites to GitHub Pages, including automation and deployment infrastructure. The supplied code chunk does not implement any deployment, repository, CI/CD, or initialization behavior. Instead, it is purely front-end browser code that adds interactive behavior to a static portfolio page. This is a materially different primary purpose from the declared skill behavior, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly instructs autonomous repository creation, GitHub Pages configuration, pushing commits, and triggering deployment, but does not prominently require user confirmation before remote publication and GitHub-side changes. In an agent context, this can lead to unintended creation of public infrastructure, accidental disclosure of content, or modification of a user's GitHub account state without sufficiently informed consent.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
84% confidence
Finding

Automatic deployment on push creates an autonomous path from content generation to public publication. In this skill's context, that is risky because generated or sensitive content could be published without a final human review, and repository workflow automation can amplify mistakes across branches and environments.

Content

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

md
### 4. Deployment

GitHub Actions automatically deploys on push to main branch. The workflow:
- Checks out code
- Deploys to `gh-pages` branch
- Makes site live at `https://<username>.github.io/<project-name>/`

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/workflow.md (reported line 122)May include surrounding context.

git push origin main

text

### GitHub Actions Auto-Deploy
- Triggers on push to main
- Builds and deploys to gh-pages branch
- Live site updates automatically

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/init_project.sh (reported line 107)May include surrounding context.

sh
## Deployment

Automatically deployed to GitHub Pages on push to main branch.
EOF

# Create GitHub Actions workflow

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The example user requests are written only in French, which can imply a fixed language expectation in the skill's invocation examples. There is no accompanying note that the skill is multilingual or intentionally French-only for a documented regional use case.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template includes explicit security/privacy marketing claims ('Secure & Private' and 'Your data is encrypted and never shared') even though this static HTML page does not implement or demonstrate any such controls. If reused as-is, site operators could mislead users about data handling or security posture, creating compliance, trust, and legal risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This HTML template includes a contact form that requests name, email, and message content, which are user data fields. The page provides no visible notice about what happens to submitted data, whether it is transmitted, stored, or who receives it, which is a missing user warning for a privacy-affecting behavior in a markdown/code-scoped file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file includes a contact form pattern that solicits name, email, and message fields, which are user data elements. The surrounding description provides no warning or disclosure about how submitted data may be handled, stored, or sent, which can omit important user-facing safety context in a reusable skill/reference document.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This shell script performs a series of file-system write operations, including creating directories and writing files such as index.html, styles.css, README.md, and a GitHub Actions workflow. Although the actions are central to the script's purpose, there is no confirmation prompt or explicit warning that existing files in the target directory may be overwritten.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.