semgrep-rule-creator

skills-sh:trailofbits_skills__semgrep-rule-creator

View source
D
47/100

First Seen

Feb 18, 2026

Last Scanned

Feb 20, 2026

Findings

9

Score

47/100

HIGH 3
MEDIUM 1
LOW 5

Findings (9)

HIGH
Code block labeled "markdown" contains executable content
L47

Code block labeled "markdown" contains executable content

# BAD: Matches any function call
pattern: $FUNC(...)

# GOOD: Specific dangerous function
pattern: eval(...)
FIX

Align the tool description with what the code actually does. If the description says one thing but the code does another, update the description to be accurate or fix the code.

FP?

Likely FP if the NLP analyzer misinterpreted technical jargon or the description accurately describes behavior through domain-specific terminology.

HIGH
Code block labeled "markdown" contains executable content
L73

Code block labeled "markdown" contains executable content

# BAD: Only matches exact format
pattern: os.system("rm " + $VAR)

# GOOD: Matches all os.system calls with taint tracking
mode: taint
pattern-sinks:
  - pattern: os.system(...)
FIX

Align the tool description with what the code actually does. If the description says one thing but the code does another, update the description to be accurate or fix the code.

FP?

Likely FP if the NLP analyzer misinterpreted technical jargon or the description accurately describes behavior through domain-specific terminology.

HIGH
Code block labeled "markdown" contains executable content
L117

Code block labeled "markdown" contains executable content

rules:
  - id: insecure-eval
    languages: [python]
    severity: HIGH
    message: User input passed to eval() allows code execution
    mode: taint
    pattern-sources:
      - pattern: request.arg...
FIX

Align the tool description with what the code actually does. If the description says one thing but the code does another, update the description to be accurate or fix the code.

FP?

Likely FP if the NLP analyzer misinterpreted technical jargon or the description accurately describes behavior through domain-specific terminology.

MEDIUM
Dynamic code evaluation
L103

Detects eval() or exec() used for dynamic code execution

eval($
FIX

Replace eval()/exec() with a safer alternative such as json.loads(), ast.literal_eval(), or a purpose-built parser.

FP?

Likely FP if the matched text contains 'exec' as part of a word (e.g., 'execute', 'execution') rather than an actual eval() or exec() call.

LOW
Unscoped Bash tool in allowed tools
L4

Detects skills that include unscoped Bash in their allowed tools list (not Bash(cmd:*) scoped)

allowed-tools:
  - Bash
FIX

Scope the Bash tool to specific commands using allowedTools patterns (e.g., Bash(git *) instead of bare Bash). Remove blanket Bash access from allowed_tools lists.

FP?

Likely FP if the Bash entry in allowed_tools is part of a constrained configuration that limits commands elsewhere (e.g., via system prompt restrictions).

LOW
Python subprocess execution
L74

Detects Python subprocess and os.system calls for command execution in skill descriptions

os.system(
FIX

Pass arguments as an explicit list instead of a shell string. Set shell=False and validate all user-supplied values before inclusion.

FP?

Likely FP if the match is in documentation explaining Python subprocess usage or in a description mentioning it as a topic.

LOW
Python subprocess execution
L79

Detects Python subprocess and os.system calls for command execution in skill descriptions

os.system(
FIX

Pass arguments as an explicit list instead of a shell string. Set shell=False and validate all user-supplied values before inclusion.

FP?

Likely FP if the match is in documentation explaining Python subprocess usage or in a description mentioning it as a topic.

LOW
Dynamic code evaluation
L132

Detects eval() or exec() used for dynamic code execution

eval(r
FIX

Replace eval()/exec() with a safer alternative such as json.loads(), ast.literal_eval(), or a purpose-built parser.

FP?

Likely FP if the matched text contains 'exec' as part of a word (e.g., 'execute', 'execution') rather than an actual eval() or exec() call.

LOW
Dynamic code evaluation
L135

Detects eval() or exec() used for dynamic code execution

eval("
FIX

Replace eval()/exec() with a safer alternative such as json.loads(), ast.literal_eval(), or a purpose-built parser.

FP?

Likely FP if the matched text contains 'exec' as part of a word (e.g., 'execute', 'execution') rather than an actual eval() or exec() call.