Inside Nuclei Templates: How 12,000 YAML Files Became the Lingua Franca of Vulnerability Detection
Hook
When a critical Log4Shell vulnerability emerged in December 2021, security teams worldwide had a working Nuclei template within hours—faster than most vendors could even issue advisories. This is the power of crowdsourced security intelligence at scale.
Context
Before Nuclei templates, vulnerability scanning was fragmented across proprietary tools with different syntaxes, closed-source detection logic, and glacially slow update cycles. Security researchers would discover a new vulnerability, but translating that knowledge into scannable checks meant writing custom scripts in Python, Ruby, or whatever language your scanner supported. Each tool had its own ecosystem: Nmap had NSE scripts in Lua, Metasploit had modules in Ruby, Burp had extensions in Java. If you wanted comprehensive coverage, you needed to maintain checks across multiple platforms.
ProjectDiscovery's nuclei-templates repository emerged as a different approach: a single, declarative YAML format that anyone could contribute to, covering any protocol or technology. Launched alongside the Nuclei scanner engine, it adopted a Wikipedia-like model where the community collectively maintains a living knowledge base of security checks. Today, with nearly 12,000 templates and contributions from hundreds of researchers, it's become the de facto standard for expressing vulnerability detection logic—a universal language that transcends individual tools and vendors.
Technical Insight
At its core, a Nuclei template is deceptively simple: a YAML document that describes what to send, where to send it, and what response indicates a vulnerability. But this simplicity masks sophisticated capability. Templates support HTTP/HTTPS, DNS, TCP/UDP network protocols, file system checks, and even code analysis, all expressed in the same declarative syntax.
Here's a real template structure that detects an exposed Git configuration file:
id: git-config
info:
name: Git Config File Disclosure
author: pdteam
severity: medium
description: Checks for publicly accessible .git/config files
tags: exposure,git,config
requests:
- method: GET
path:
- "{{BaseURL}}/.git/config"
matchers-condition: and
matchers:
- type: word
words:
- "[core]"
- "repositoryformatversion"
condition: and
- type: status
status:
- 200
This structure reveals the template philosophy: separate concerns cleanly. The info block provides metadata for categorization and filtering. The requests block defines the actual test—in this case, a simple GET request with variable interpolation via {{BaseURL}}. The matchers block specifies success conditions using boolean logic.
Where things get interesting is in the matcher flexibility. Templates support word matching, regex patterns, binary data matching, DSL expressions for complex logic, and even negative matching. For CVE detection, you might chain multiple requests where later requests use data extracted from earlier ones:
requests:
- method: GET
path:
- "{{BaseURL}}/api/version"
extractors:
- type: regex
name: version
internal: true
regex:
- '"version":"([0-9.]+)"'
- method: POST
path:
- "{{BaseURL}}/api/exploit"
headers:
Content-Type: application/json
body: '{"version":"{{version}}"}'
matchers:
- type: word
words:
- "admin_token"
This chaining capability makes templates powerful for multi-step vulnerability verification, reducing false positives by confirming vulnerabilities through exploitation rather than just version detection.
The repository's organization reflects real-world security testing workflows. Templates live in directories like cves/, exposures/, misconfiguration/, technologies/, and vulnerabilities/. The massive technologies/ directory contains 873 subdirectories—one for each major platform from Apache to Zoom. This means you can scan specifically for WordPress vulnerabilities without running thousands of irrelevant checks, dramatically improving scan efficiency.
Template metadata enables sophisticated filtering. Every template declares severity (info, low, medium, high, critical), tags for categorization, and references to CVE IDs, CWE classifications, and external advisories. The Nuclei engine can execute subsets like "run only critical and high severity templates" or "scan for CVEs from 2024" without manual curation.
What makes this architecture scale is the validation pipeline. The repository uses GitHub Actions to lint every template submission, checking YAML syntax, required fields, and matcher logic. Templates are automatically tested against known vulnerable targets to verify they actually work. This CI/CD approach to vulnerability detection is novel—treat security checks as code with all the quality gates that implies.
Gotcha
The repository's greatest strength—community contributions at scale—is also its Achilles heel. Template quality varies wildly. Some templates are meticulously crafted with multiple matchers, minimal false positives, and clear documentation. Others are hastily written, match overly broad patterns, or flag informational findings as critical vulnerabilities. There's no peer review requirement for contributions, and templates can go months without updates even when detection logic becomes outdated.
False positives are endemic, particularly in the exposures/ and technologies/ categories. A template might detect a login page and flag it as "Admin Panel Exposure" when that's intentional and properly secured. Information disclosure templates often match benign version strings or error messages that don't actually represent exploitable conditions. In production security programs, you'll spend significant time building suppression lists and custom filtering to separate signal from noise. Expect to manually verify 30-40% of findings before reporting them.
The WordPress-heavy focus (1,261 templates) reflects community interests in bug bounty hunting but creates coverage gaps elsewhere. Kubernetes, infrastructure-as-code, and cloud-native technologies are comparatively underrepresented. Mobile API testing is minimal. If your stack doesn't align with popular bug bounty targets, you may find yourself writing custom templates rather than leveraging community contributions. Additionally, since templates are YAML documents, they can't express arbitrarily complex logic—sophisticated vulnerabilities requiring state management or complex cryptographic operations fall outside the format's capabilities.
Verdict
Use nuclei-templates if you're running offensive security programs—red teams, penetration testing, or bug bounty hunting—where comprehensive coverage of known vulnerabilities matters more than surgical precision. The repository excels at casting a wide net during reconnaissance, quickly identifying low-hanging fruit across diverse technology stacks, and maintaining detection for emerging CVEs within days of disclosure. It's invaluable for continuous security monitoring where you want to know the moment a newly discovered vulnerability appears in your infrastructure. Skip it if you need enterprise-grade accuracy for compliance reporting, lack resources for manual verification of findings, or require guaranteed SLAs on template quality and maintenance. It's also the wrong choice for highly specialized environments where you'll need custom detection logic anyway—at that point, you're better off writing targeted checks from scratch rather than sifting through thousands of irrelevant templates. Best suited for security professionals who understand the difference between a potential vulnerability and a confirmed exploit, and who have the expertise to validate findings before taking action.