Back to skill

Security audit

OSNK Trainer

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed OSNK practice skill with local question files and a bash helper; its main risk is mutable GitHub fallback content, not credential theft or system control.

Install only if you are comfortable with a local bash helper that writes progress files under workspace memory and may contact raw.githubusercontent.com for missing question files. For strict offline or reviewed-only use, disable network access or remove the GitHub fallback, and verify answer keys against official sources.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Warning
Location
run.sh:29
Finding

Mutable, Unverified Remote Question-Bank Content

Content
View full analysis

Vulnerability Details

File Location: run.sh:29-43 and run.sh:73-85
Vulnerability Type: Unpinned remote content dependency
Risk Level: Medium

Complete Code Snippet

bash
# Question bank sources (priority: local > skill folder > GitHub fallback)
KB_REPO="https://raw.githubusercontent.com/jrrqd/osnk-question-bank/master"

get_kb_file() {
    local file="$1"
    # 1. Check workspace knowledge folder
    if [ -f "$KB_DIR/$file" ]; then
        cat "$KB_DIR/$file"
    # 2. Check skill folder (embedded)
    elif [ -f "$SCRIPT_DIR/$file" ]; then
        cat "$SCRIPT_DIR/$file"
    # 3. Fallback to GitHub
    else
        curl -s "$KB_REPO/$file" 2>/dev/null || echo ""
    fi
}
bash
else
    if [ -f "$KB_DIR/osk-$year.md" ]; then
        shuf -n 1 "$KB_DIR/osk-$year.md" | head -15
    elif [ -f "$SCRIPT_DIR/osk-$year.md" ]; then
        shuf -n 1 "$SCRIPT_DIR/osk-$year.md" | head -15
    elif [ -f "$KB_DIR/osnk-$year.md" ]; then
        shuf -n 1 "$KB_DIR/osnk-$year.md" | head -15
    elif [ -f "$SCRIPT_DIR/osnk-$year.md" ]; then
        shuf -n 1 "$SCRIPT_DIR/osnk-$year.md" | head -15
    else
        curl -s "$KB_REPO/osk-$year.md" | head -15 || echo "Year $year not found"
    fi
fi

Technical Analysis

When a requested local question-bank file is unavailable, the script retrieves Markdown from the master branch of an external GitHub repository. The branch is mutable, and the response is not authenticated beyond ordinary TLS, pinned to a reviewed commit, or validated against an expected cryptographic digest.

The downloaded content is not executed as shell code, so this is not remote code execution. However, it is subsequently displayed as question content. In an AI-agent environment, malicious Markdown could contain instruction-like text intended to influence the agent, making the untrusted content a potential indirect prompt-injection or output-m ...[truncated 1284 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the remote fallback and rely exclusively on the bundled, reviewable question bank.
  2. If remote updates are required, pin requests to an immutable reviewed Git commit rather than master.
  3. Maintain a SHA-256 allowlist for every remotely retrievable file and reject responses that fail verification.
  4. Use curl --fail --show-error --location with explicit connection and overall timeouts.
  5. Require explicit user consent before initiating network access.
  6. Treat downloaded Markdown strictly as untrusted data and clearly delimit it from agent instructions.
  7. Consider performing updates only through signed, versioned Skill releases instead of runtime retrieval.

T09 · Insecure Skill Coding Practices

Warning
Location
run.sh:137
Finding

Unbounded User-Controlled Question Count Enables Resource Exhaustion

Content
View full analysis

Vulnerability Details

File Location: run.sh:137-143
Vulnerability Type: Missing numeric validation and resource limit
Risk Level: Medium

Complete Code Snippet

bash
"random"|"questions"|"give")
    num="${1:-5}"
    topic="$*"

    echo "🎯 $num random questions:"
    echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
    for i in $(seq 1 $num); do
        echo ""
        echo "Question $i:"
        get_random_question "" "" | head -8
    done

Technical Analysis

The first command argument is used directly as the upper bound for seq without verifying that it is a reasonably bounded positive integer. Each iteration calls get_random_question, which launches several external processes such as find, shuf, grep, and head.

Supplying an extremely large numeric value can therefore produce excessive iterations, process creation, filesystem reads, CPU consumption, and output. The unquoted expansion in seq 1 $num also permits argument splitting, although the confirmed security impact from the reviewed code is resource exhaustion rather than command execution.

Attack Path

  1. A user or upstream caller invokes the Skill's question command with an extremely large count.
  2. The value is assigned to num without validation or a maximum limit.
  3. seq generates a correspondingly large sequence.
  4. The loop repeatedly invokes question-selection pipelines and emits output.
  5. The Skill consumes excessive CPU, process slots, filesystem I/O, execution time, and output capacity until interrupted or externally limited.

Impact Assessment

Exploitation does not grant additional filesystem privileges or arbitrary command execution. The impact is availability loss within the Skill process or its containing workspace. Depending on sandbox limits, it may cause request timeouts, degrade other workloads sharing the runtime, or terminate the agent session because of excessive output or resou ...[truncated 8 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate the value with a strict integer pattern before use:
    bash
    if [[ ! "$num" =~ ^[0-9]+$ ]]; then
        echo "Question count must be a positive integer." >&2
        exit 1
    fi
    
  2. Enforce a conservative upper bound, such as 100 questions:
    bash
    if (( num < 1 || num > 100 )); then
        echo "Question count must be between 1 and 100." >&2
        exit 1
    fi
    
  3. Use an arithmetic Bash loop to avoid invoking and expanding seq:
    bash
    for ((i = 1; i <= num; i++)); do
        # Retrieve and display the question.
    done
    
  4. Apply runtime and output limits at the sandbox or caller level as defense in depth.
  5. Cache the available question-file list instead of repeatedly launching filesystem-search processes during every iteration.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (39)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented behavior indicates undeclared network access via curl to GitHub fallback sources despite repeated claims that the skill is offline, does not send data out, and needs no API. This mismatch is dangerous because hidden remote fetching changes the trust boundary: remote content can influence outputs, availability, and possibly downstream shell/file handling, while users are misled about privacy and execution behavior.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · SECURITY.md (reported line 8)May include surrounding context.

md
## Script Purpose
`run.sh` is a **simple bash command handler** that processes user natural language commands and routes them to appropriate functions within OpenClaw. It does NOT:
- Execute arbitrary code from external sources
- Download or run unverified executables
- Modify system files outside the workspace
- Access network resources except for optional GitHub fallbacks

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · SECURITY.md (reported line 10)May include surrounding context.

md
`run.sh` is a **simple bash command handler** that processes user natural language commands and routes them to appropriate functions within OpenClaw. It does NOT:
- Execute arbitrary code from external sources
- Download or run unverified executables
- Modify system files outside the workspace
- Access network resources except for optional GitHub fallbacks
- Collect or transmit user data

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document explicitly presents the tasks as 'Soal dalam bahasa Indonesia' and all user-facing content is in Indonesian, but it does not offer an alternative language or indicate that the locale restriction is intentional and justified. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file is natural-language content and it consistently forces a single language/locale throughout the skill material. Under the policy, language constraints should either be justified as region-specific or offer the user an explicit choice; neither is present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file contains two immediately repeated logic questions with the same text but different answer keys, which creates contradictory instructional content. In an educational skill, this can mislead learners, corrupt assessment accuracy, and reduce trust in the material, though it does not appear to enable code execution or system compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill silently falls back to fetching question-bank content from a remote GitHub repository, which means its behavior and content can change outside the packaged skill. This creates a supply-chain and trust-boundary issue: a repository compromise, owner change, or content tampering could alter what users receive without review or notice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code performs an undisclosed remote fetch with curl, so user interactions may cause network access and import unreviewed external content without transparency. This is dangerous because it hides data-flow and trust assumptions from users and can expose them to manipulated or unavailable remote content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-facing strings and help text are presented in Indonesian only, such as "Belum ada sesi latihan!" and "Contoh perintah," with no option to choose another language. This can violate language/locale policy when a skill imposes a specific language by default without explicit user opt-in or documented regional scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is a static markdown list of 20 Bebras 2017 questions with brief descriptions and answers. It does not implement or document smart practice, speed-run features, performance tracking, or mentoring behavior described in the manifest, indicating the artifact's actual content is narrower than the claimed skill scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The title and all instructional content are written in Indonesian, with no indication that users may choose another language or that the file is intentionally limited to an Indonesian-only audience. Under the policy rule for language or locale constraints, this is a natural-language locale restriction without opt-in or explicit justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document is entirely presented in Indonesian and explicitly labeled for 'Bebras Indonesia', with no indication that users may choose another language or locale. The policy for natural-language violations applies to all file types and flags language constraints when no opt-in or alternative is offered.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Indonesian, and there is no indication that the skill is region-specific or that users can opt into another language. Under the policy rule for natural-language violations, forcing a specific language without opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file explicitly presents the tasks as 'Soal dalam bahasa Indonesia' and the entire content is written only in Indonesian. Under the policy rule for natural-language violations, forcing a specific language without opt-in can be a locale-policy issue when no alternative or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The repeated 'Soal dalam bahasa Indonesia' heading indicates the skill consistently mandates Indonesian for interaction/content. Because no language selection or region-specific justification is present in the file, this may violate the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains user-facing task descriptions exclusively in Indonesian, and there is no indication that the user can opt into another language or that the skill is intentionally restricted to Indonesian-language use. The policy requires flagging language or locale constraints when they are imposed without user choice or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is primarily written in Indonesian, but Task 6 suddenly introduces Chinese text ("排队") and several English bullet points. Because the file does not provide any user opt-in or language selection, it can violate the language/locale consistency policy for user-facing content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is primarily written in Indonesian, but line L011 introduces Cyrillic text ("машина") instead of keeping a consistent language choice. This can violate language/locale expectations because the content forces mixed-language output without explanation or user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is written for Indonesian readers, but line L030 contains the Chinese term "填入" embedded in an Indonesian sentence. This introduces a language/locale inconsistency without offering a choice or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Lines L106-L110 include the Chinese word "操作" in otherwise Indonesian text. This is a natural-language policy concern because the file imposes mixed-language terminology without documenting or offering a language option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file presents all user-facing instructional content in a single forced language, Indonesian, and does not provide any opt-in, alternative language, or note that the content is intentionally region-specific. Under the stated policy, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The document is written entirely in Indonesian and does not indicate any user language choice, opt-in, or justification for a locale restriction. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a finding when no region-specific constraint is documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file presents all instructional content and problem text exclusively in Indonesian, with no indication that the user can choose another language. Under the policy rule for natural-language violations, forcing a specific language without opt-in can be a locale-policy issue unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file is natural-language content and consistently forces a single language/locale throughout the skill material. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific; this file provides no such opt-in or justification.

Content

No source excerpt is available for this finding.