Back to skill

Security audit

杠精 Gangjing

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent red-team/code-review helper, but it can create and run attack harnesses against workspace code without strong enforced isolation or explicit execution consent.

Install only if you want an aggressive Chinese-language red-team reviewer. Before allowing code testing, use an isolated disposable workspace or container, remove secrets from the environment, disable network access where possible, and require a clear manual confirmation before any harness is written or run.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
templates/attack-engine-kit.md:181
Finding

Python Harness Executes Target Module Before Applying Process Isolation and Timeout

Content
View full analysis

Vulnerability Details

File Location: templates/attack-engine-kit.md, lines 181–186, 211–242, and 351–352
Vulnerability Type: Uncontained execution of target module initialization code
Risk Level: High

Vulnerable Code

python
def load_target(module_path: str, function_name: str):
    """Dynamically load a function from a file path."""
    path = Path(module_path).resolve()
    spec = importlib.util.spec_from_file_location("target_module", path)
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    return getattr(module, function_name)
python
def run_single_attack(target_func, attack, timeout):
    """Run one attack vector with timeout + semantic validation."""
    # ...

    def _execute(conn):
        try:
            start = time.monotonic()
            ret = target_func(*args, **kwargs)
            elapsed = (time.monotonic() - start) * 1000
            conn.send(("ok", ret, elapsed))
        except Exception as e:
            elapsed = (time.monotonic() - start) * 1000
            conn.send(("exception", f"{type(e).__name__}: {e}", elapsed))

    parent_conn, child_conn = multiprocessing.Pipe()
    proc = multiprocessing.Process(target=_execute, args=(child_conn,))
    proc.start()
    proc.join(timeout=timeout)
python
target_path = resolve_target_path(args.config, config["target_module"])
target_func = load_target(str(target_path), config["target_function"])

Technical Analysis

The harness resolves the target to a file under the attack configuration directory, but then imports that target in the parent harness process through spec.loader.exec_module(module). Python module import executes all top-level statements in the selected file.

The target is therefore executed before run_single_attack() creates the timeout-controlled child process. The timeout protects only the subsequent target-function invocation; it does not protect module initialization.

A malicious or com ...[truncated 2716 chars]

Remediation
View remediation

Remediation Suggestions

  1. Move both module import and function invocation into the isolated child process. The parent process should pass only the validated target path, function name, arguments, and test metadata to the child.
  2. Start the timeout before module loading and apply it to the child's entire lifecycle, including interpreter startup, import, initialization, and function execution.
  3. Run the child in a disposable operating-system sandbox or container with:
    • A non-privileged user.
    • A read-only copy of the target workspace.
    • A dedicated temporary writable directory.
    • No access to home, SSH, cloud credential, or other sensitive directories.
    • Sensitive environment variables removed.
    • Network access disabled by default.
    • CPU, memory, process-count, and file-size limits.
  4. Fail closed when the required isolation cannot be established. Do not treat ordinary multiprocessing as a security boundary.
  5. Prevent background-process escape by using a dedicated process group, namespace, container, or job object and terminating the entire group after each test.
  6. Resolve and validate symlinks immediately before the child opens the target. Where supported, use race-resistant file opening and mount the approved workspace as the only readable source tree.
  7. Write output reports only beneath an explicitly approved directory and validate output paths similarly to target paths.
  8. Clearly state in the generated harness output whether strong sandboxing is active, rather than describing process separation alone as isolation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (33)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README states the skill will 'automatically intervene' during normal conversation, which creates an overly broad trigger boundary. That can cause unintended activation in unrelated contexts, leading the agent to switch into an adversarial or disruptive review mode without explicit user consent and potentially interfere with normal tasks or testing flows.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly says it can be broadly triggered, which increases the chance of unintended activation from ordinary user phrasing. In context, that mostly creates reliability and UX risk, but because the skill can later escalate into code-reading and attack-harness behavior, accidental invocation can also steer an agent into unnecessarily adversarial or risky actions.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 如果当前分发包里有 `references/attack-patterns.md`,优先按它的模板生成

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 如果当前分发包里有 `references/attack-patterns.md`,优先按它的模板生成

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
# 否则先从 templates/attack-engine-kit.md 落地临时 harness

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
# 否则先从 templates/attack-engine-kit.md 落地临时 harness

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 · references/attack-patterns.md (reported line 160)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",

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 · references/attack-patterns.md (reported line 167)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",

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 · references/attack-patterns.md (reported line 175)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",

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 · references/attack-patterns.md (reported line 177)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",

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 · references/attack-patterns.md (reported line 181)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

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

Content

Scanner excerpt · references/attack-patterns.md (reported line 161)May include surrounding context.

python
cmd_payloads = [
    "; ls -la /etc/passwd",
    "| cat /etc/shadow",
    "$(whoami)",
    "`id`",
    "& ping -c 3 attacker.com",

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/attack-patterns.md (reported line 166)May include surrounding context.

"id", "& ping -c 3 attacker.com", "\n/bin/sh", "file.txt; rm -rf /", "../../../etc/passwd", ]

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/attack-patterns.md (reported line 166)May include surrounding context.

"id", "& ping -c 3 attacker.com", "\n/bin/sh", "file.txt; rm -rf /", "../../../etc/passwd", ]

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/attack-patterns.md (reported line 166)May include surrounding context.

"id", "& ping -c 3 attacker.com", "\n/bin/sh", "file.txt; rm -rf /", "../../../etc/passwd", ]

text

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/attack-patterns.md (reported line 166)May include surrounding context.

"id", "& ping -c 3 attacker.com", "\n/bin/sh", "file.txt; rm -rf /", "../../../etc/passwd", ]

text

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/attack-patterns.md (reported line 632)May include surrounding context.

// All print 5, not 0-4 (pre-Go 1.22)

text

### Rust-Specific

```rust
// Integer overflow (wraps silently in release mode!)
let x: u8 = 255;
let y = x + 1;  // debug: panic!, release: y = 0

// Deadlock with multiple mutexes
let a = Mutex::new(1);
let b = Mutex::new(2);
// Thread 1: lock(a) then lock(b)
// Thread 2: lock(b) then lock(a) → DEADLOCK

// Panic in Drop
impl Drop for Bomb {
    fn drop(&mut self) {
        panic!("boom");  // double-panic = abort
    }
}

10. Silent Failure Patterns

These are the hardest bugs to catch — the code runs without error, returns a result, but the result is wrong, dangerous, or nonsensical. A dumb fuzzer marks these as "passed". The semantic analysis layer (Step 3.5 in SKILL.md) exists specifically to catch them.

10.1 NaN Propagation

NaN is a silent killer in numeric validation. Any comparison with NaN returns False, so range checks pass silently:

python
age = float('nan')
if age < 0 or age > 150:   # False or False

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The recommended tag chinese indicates the skill is scoped to a specific language, but the document does not offer any user choice or opt-in for language/locale. Under the policy, language constraints should be explicit and user-selectable unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The phrase '杠一下' is generic enough to appear in ordinary discussion, making activation control unreliable. A loosely scoped trigger increases the chance of accidental invocation of a skill designed to be confrontational and, in some modes, to escalate into code attack/verification behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description and subsequent instructions require the skill to behave and speak as a '杠精' in Chinese by default, with no indication that the user can choose another language or locale. This can violate language or locale policy because it imposes a specific language preference without explicit user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section instructs the agent to generate harnesses and execute them against target code, including code that may import and run top-level module logic. Although some boundaries are mentioned, the skill still operationalizes execution of attacker-style test inputs and does not prominently require dry-run defaults, explicit informed consent, or isolation guarantees, creating real risk of destructive side effects, secret exposure, or unsafe code execution in the user environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The entire usage documentation is written as a Chinese-only instruction set and does not indicate that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to activate during ordinary discussion, especially terms like “杠一下” and “roast this,” which can appear in benign conversation without a deliberate request to invoke an adversarial review mode. In this skill, accidental activation is more concerning because the documented behavior can escalate from verbal critique to code-attack and crash-verification workflows, increasing the chance of unintended risky actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly instructs the agent to run attack/fuzzing harnesses against repository code and provides ready-to-use commands, but it does not require explicit user confirmation, sandboxing, or side-effect limits first. In an agent skill context, this can cause unapproved execution of adversarial test payloads, unintended code mutation or service interaction, and elevation from advisory analysis into active offensive behavior.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.