ctf-skills
- Type
- Skill
- Scanned
- Nov 17, 2026
- Version
- 20d182d9377f
- Files read
- 282
This project gives AI coding agents guides, scripts, and configurations to solve Capture The Flag (CTF) cybersecurity challenges across areas like web security, cryptography, forensics, and reverse engineering. The biggest risk is that it tells the AI agent to open or run untrusted challenge programs, unsafe AI model files, and archives directly on your computer without a sandbox, while bundled OpenCode configurations automatically approve shell commands without asking you first.
What it can reach
- Shell commands
- Runs terminal commands and scripts (with automatic approval in OpenCode configurations) to install tools, compile code, run debuggers, and launch exploit scripts.
- Files
- Reads, writes, searches, and edits local files to inspect challenge files, unpack archives, save solver scripts and reports, and store downloaded tools and wordlists in ~/.ctf-tools/.
- Network
- Searches the web, connects to challenge servers with network tools, downloads packages from GitHub and PyPI, and talks to external services like Tavily, Shodan, BlueSky, webhook.site, and CTFd.
- Secrets
- Reads TAVILY_API_KEY from your environment variables and uses API tokens you provide (such as CTF_TOKEN) to query Tavily, CTFd, and online research services.
- Browser
- Controls a web browser through Playwright (when configured) to load pages, keep login sessions active, and inspect page content and network traffic.
- System
- Uses administrator access (sudo) in setup scripts and forensics guides to install system software packages and mount disk images.
Findings
-
HighReverse-engineering skill instructs running untrusted challenge binaries directly on the host
Under 'Quick Wins (Try First!)', ctf-reverse/SKILL.md instructs the agent to chmod +x the target binary and run it directly with ltrace, strace, and test inputs. Unlike ctf-malware/SKILL.md, which warns to run samples only in an isolated, disposable VM, ctf-reverse/SKILL.md contains no sandboxing requirement, so a trojanized CTF binary handed to the agent will execute with full user privileges on the host.
Fix: Add an explicit requirement in ctf-reverse/SKILL.md and solve-challenge/SKILL.md to execute untrusted challenge binaries only inside an unprivileged container or disposable VM.
-
HighOpenCode agent definitions auto-approve all shell, file-edit, and web actions
.opencode/agents/ctf-leader.md:5
ctf-leader.md and all eight specialist agent files in .opencode/agents/ configure effect: allow on resource: * for shell, read, edit, webfetch, and websearch. When solving challenges against untrusted CTF web pages, network services, or artifacts, prompt injection in fetched content or service banners can make the agent run arbitrary shell commands and exfiltrate local files without any user confirmation prompt.
Fix: Change effect: allow to effect: ask for shell, edit, and webfetch across .opencode/agents/*.md, or scope file edits to the current workspace.
-
MediumUnsafe PyTorch pickle deserialization with weights_only=False on challenge models
The AI/ML skill instructs the agent to load third-party CTF challenge model files (.pt) with weights_only=False, overriding PyTorch 2.6+'s safe default. Because PyTorch model archives use Python's pickle format, loading a booby-trapped challenge model immediately executes arbitrary code on the user's host machine, and ctf-ai-ml/SKILL.md does not instruct running inside a disposable VM or container.
Fix: Keep weights_only=True by default, inspect untrusted model files statically with pickletools or safetensors first, and require an isolated, disposable VM or container whenever weights_only=False is necessary.
-
MediumRemote code execution via Python eval() on OCR output from an untrusted webpage
ctf-misc/games-and-vms-4.md:190
The dynamic CAPTCHA solver template screenshots a remote CTF webpage, extracts text with Tesseract OCR into expr, and passes expr directly into Python's eval() on the host machine (with an audit-ok comment suppressing the repository's security scanner). A malicious challenge server can render Python code in its page image to trigger local code execution when the agent adapts and runs this script; ctf-crypto/prng.md similarly calls eval(f.read()) on external gzip data.
Fix: Replace eval() with a safe arithmetic parser using ast.parse restricted to numeric literals and math operators (or ast.literal_eval for data files), and remove the audit-ok suppression.
-
MediumUnpinned on-demand git clone of external payload repository and unpinned tool installs
ctf-web/SKILL.md instructs the agent to lazy-clone the mutable default branch of swisskyrepo/PayloadsAllTheThings at runtime into ctf-web/payloads/PayloadsAllTheThings and read markdown files from it, without checking out the commit hash noted in pat-reference.md. scripts/install_ctf_tools.sh likewise clones PayloadsAllTheThings at HEAD and installs unpinned gems and go install github.com/ffuf/ffuf/v2@latest, creating a supply-chain and indirect prompt-injection risk if upstream repositories are compromised.
Fix: Pin PayloadsAllTheThings to a verified immutable commit SHA during both lazy-cloning and install_ctf_tools.sh, and pin exact versions for Go tools, Ruby gems, and Git repositories.
-
MediumPath traversal (TarSlip) via unfiltered tarfile.extractall() on untrusted archives
ctf-forensics/stego-advanced.md:316
The recursive nested-tar extraction helper calls tf.extractall() without filter='data' or member path checks. On Python 3.12 and 3.13 (supported by pyproject.toml), extracting a malicious CTF tar archive containing '../' paths or symlinks can overwrite arbitrary files outside the working directory on the user's machine.
Fix: Pass filter='data' to tf.extractall(f'layer_{depth}', filter='data') so path traversal and external symlinks are rejected.
-
LowUnverified curl-to-bash remote script execution in GDB/GEF setup guide
ctf-reverse/tools-advanced-2.md:153
The advanced GDB guide instructs installing GEF by fetching https://gef.blah.cat/sh with curl and passing the response directly to bash -c without any commit pin or checksum verification. If the remote host or domain is compromised when the user or agent runs this setup command, arbitrary shell commands run immediately.
Fix: Download GEF from a pinned GitHub commit or release tag and verify its SHA-256 checksum before sourcing it.
-
LowSkill instructs disabling Burp Suite MCP human-approval gates
ctf-web/SKILL.md tells users to turn off both approval gates in Burp Suite's MCP tab so tool calls do not block on modal dialogs, without warning about the risk. With approval gates off, prompt injection inside an untrusted web response read by the agent can silently read sensitive browser traffic from Burp proxy history or issue arbitrary HTTP requests through Burp.
Fix: Recommend keeping Burp MCP approval gates enabled (or restricting auto-approval strictly to the CTF target host in an isolated Burp instance with no personal browsing sessions).
-
LowTLS certificate verification unconditionally disabled in async fuzzer mode
ctf-web/scripts/async_fuzz.py:71
While threaded mode only disables TLS certificate verification when an HTTP proxy is configured, run_async(--async) hardcodes verify=False alongside follow_redirects=True on all HTTPS connections, exposing traffic to network interception without an explicit opt-in flag.
Fix: Keep verify=True by default in httpx.AsyncClient and only disable certificate verification when --proxy or an explicit --insecure flag is passed.
-
LowOver-broad tool permissions granted to writeup generator skill
ctf-writeup only needs to read existing session artifacts and write a local markdown file, yet its frontmatter grants Bash, WebFetch, WebSearch, and Task. If untrusted challenge logs read during writeup generation contain prompt injection, these extra tools allow unnecessary command execution and data exfiltration.
Fix: Restrict allowed-tools in ctf-writeup/SKILL.md to Read, Write, Edit, Glob, and Grep.
-
LowBurp Suite MCP guide recommends disabling approval gates and enabling config edits
The Burp Suite MCP setup table recommends turning off Require approval for HTTP requests and Require approval for project data access while turning on Enable tools that can edit your config. If the agent encounters prompt injection in a proxied CTF target response, it can silently read sensitive cookies or tokens from Burp's proxy history, send raw HTTP requests to internal/localhost services, and alter global Burp user settings such as upstream proxies via set_user_options.
Fix: Keep Enable tools that can edit your config turned off, use a clean dedicated Burp project per competition, and scope auto-approval to the specific challenge host:port instead of disabling HTTP request approvals globally.
-
LowCI security audit workflow runs PR-modifiable script and interpolates directory names into Python
.github/workflows/skill-security-audit.yml:128
The pull_request trigger uses paths-ignore for scripts/**, which still runs when a PR modifies both a skill file and scripts/skill_security_auditor.py, executing the PR's modified auditor script; lines 136 and 144 also interpolate $skill_dir directly into python3 -c code. A malicious PR can forge a PASS audit artifact and spoof pr_number for the privileged workflow_run commenter workflow. This affects repository CI only and never runs on an installer's machine.
Fix: Run scripts/skill_security_auditor.py from the base branch rather than the PR checkout, pass skill_dir via an environment variable instead of string interpolation, and verify pr_number against github.event.workflow_run.pull_requests before posting comments.
