1. Canonical Structured Sources (CVE, CWE, CVSS, ATT&CK, KEV, OSV, GitHub Advisory DB)
- CVE (Common Vulnerabilities and Exposures): The CVE list is a catalog of unique vulnerability identifiers with standardized JSON schema records (current version 5.x). CVE entries include fields like an ID, description, references, and sometimes CWE or CVSS data. The official CVE JSON is available via a public Git repository (updated ~every 7 minutes via the CVE API). Older formats (CSV, XML) have been deprecated.
- Access Endpoints: You can pull CVE data by cloning the CVE Git repo or by using the CVE Services REST API for queries. NIST’s NVD also provides daily JSON feeds and an API for CVEs with additional enrichment (CVSS scores, CPEs, etc.).
- Licensing: CVE data is free to use; MITRE grants a royalty-free license for any use as long as you reproduce the CVE copyright and disclaimer. (In practice, CVE and NVD data are treated as public domain or CC0-equivalent, enabling broad use.)
- CWE (Common Weakness Enumeration): CWE is a structured list of software/hardware weakness types (vulnerabilities at the code/design level). CWE data is provided in XML (with an XSD schema) and also as CSV or HTML views. Each CWE entry has fields like a unique ID, description, likelihood, technical impact, and relationships (e.g. “Related Weaknesses” or mappings to CAPEC attack patterns).
- Access: The CWE website offers downloadable ZIPs of the entire CWE list (latest version) in XML/CSV. A CWE REST API is under development (by the CWE/CAPEC working group on GitHub) for programmatic access.
- Licensing: CWE content is open; MITRE similarly permits free use for research, commercial, etc., under CWE Terms of Use (requirement: include MITRE’s copyright and license notice when redistributing).
- CVSS (Common Vulnerability Scoring System): CVSS is a standardized scoring schema (not a database) for rating vulnerability severity (v3.1 is current). A CVSS score is represented by a vector string encoding metrics like Attack Vector, Complexity, Impact, etc. (e.g.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).- Access: The CVSS specification is maintained by FIRST; they provide documentation, a reference calculator, and code libraries. CVSS scores for real vulnerabilities are typically found within CVE/NVD JSON data (NVD includes CVSS v2 and v3 base scores for each CVE).
- Format: The vector string format is the primary representation; it’s a concise schema that can be parsed to compute the numeric score.
- Licensing: The CVSS standard is open and widely adopted; no licensing restrictions on using the formula or vector format (the spec is published by FIRST). Any implementation or dataset including CVSS (like NVD feeds) can be used freely; NVD’s data (including CVSS info) is U.S. government work (public domain).
- MITRE ATT&CK: ATT&CK (Adversarial Tactics, Techniques & Common Knowledge) is a knowledge base of adversary behaviors. It is structured as tactics (phases of an attack) and techniques (specific methods), each with an ID (e.g.
T1059for Command-Line Interface).- Data Format: The entire ATT&CK dataset is available in STIX 2.1 JSON format (with collections for Enterprise, Mobile, ICS domains). Objects include fields like technique description, detection guidance, references, etc.
- Access Endpoints: MITRE provides an official TAXII 2.1 server (
cti-taxii.mitre.org) that serves the ATT&CK STIX collections. Alternatively, the data is on GitHub (mitre-attack/attack-stix-datarepo) for direct download. There are also RSS/Excel exports and a web API for specific queries. - Licensing: ATT&CK content is released under an open license: MITRE grants a royalty-free license for research, development, and commercial use. (In short, you can use ATT&CK data in your model, with attribution to MITRE. The ATT&CK JSON repo even provides a LICENSE stating free use with credit.)
- CISA KEV (Known Exploited Vulnerabilities catalog): The KEV catalog is a government-curated list of vulnerabilities known to be exploited in the wild. It contains records with fields like CVE ID, vulnerability name, vendor/product, and due date for federal agencies to patch.
- Data Format: Provided as both CSV and JSON files. The JSON schema includes fields for CVE, vendor/project, product, vulnerability description, action required, and dates.
- Access: CISA offers the data on their website (downloadable CSV/JSON), and they maintain a public GitHub repo (
cisagov/kev-data) that mirrors the catalog and updates whenever the official source updates (usually weekdays). This repo also includes the JSON schema for reference. You can programmatically fetch KEV data via GitHub or by hitting the raw file URL. - Licensing: KEV data is in the public domain – CISA explicitly released it under CC0 (no copyright). This means it can be freely used and integrated into datasets without legal barriers.
- OSV (Open Source Vulnerabilities database): OSV is a distributed vulnerability database focused on open-source packages. It uses a unified JSON schema (the OpenSSF OSV format) for advisories. Each OSV record includes fields such as the vulnerability ID (e.g. CVE or GHSA), a summary, detailed description, affected package names and versions (with precise version ranges or commit hashes), references, and aliases.
- Access: OSV provides a public API (e.g. POST queries for package+version or commit hash) to look up vulns. For bulk data, OSV maintains a Google Cloud Storage bucket with the entire dataset – all advisories can be downloaded as a zip (
all.zip) or per ecosystem (PyPI/all.zipetc.). There is also a BigQuery public dataset integration for OSV via Google’s BigQuery (and an official website osv.dev for searching). - Licensing: OSV aggregates data from many sources, each with their own licenses. Most are permissive: e.g. the GitHub Advisory DB and PyPI advisories are CC-BY-4.0, RustSec and Global Security Database are CC0. The OSV project itself encourages open use; you should attribute sources like GHSA where required. In practice, using OSV data for training is acceptable as long as you honor any CC-BY attribution (e.g. keep a note of the source of each advisory). The OSV schema is open (developed with OpenSSF) and designed for interoperability.
- Access: OSV provides a public API (e.g. POST queries for package+version or commit hash) to look up vulns. For bulk data, OSV maintains a Google Cloud Storage bucket with the entire dataset – all advisories can be downloaded as a zip (
- GitHub Advisory Database: GitHub’s Advisory DB (GHSA database) contains security advisories for open source packages (covering CVEs and GitHub-originated IDs). It’s partly integrated with OSV.
- Data format: Records are stored internally (and exposed via API) with fields like GHSA ID, descriptions, severity, affected package/version info, references, and sometimes CWE IDs.
- Access: The advisories are accessible via GitHub’s GraphQL API – you can query for all advisories in an ecosystem or query by GHSA ID. GitHub also provides an interface on github.com/advisories and periodic dumps via OSV feeds. As of now, the GH Advisory DB has ~23k reviewed advisories (curated by GitHub) and a larger set of ~260k unreviewed community submissions. Using the GraphQL API, you can fetch advisories updated since a given date, filter by severity, etc..
- Licensing: The GitHub advisory data is released under CC-BY-4.0. This means you must give attribution to the GitHub Advisory Database if you use the data. (Attribution can be a note in your corpus documentation that data was sourced from the GitHub Advisory Database © GitHub, used under CC BY 4.0.) Other than attribution, there are no restrictions – the data is intended for wide security community use.
2. Narrative Sources (Vendor Advisories, Mailing Lists, Blogs, Papers)
- Vendor Security Advisories: Many software/hardware vendors publish security bulletins or advisories describing vulnerabilities in their products and the available patches. These tend to be semi-structured text (often web pages or PDFs).
- Size & Frequency: Each advisory is usually a few paragraphs or a table of affected products – often on the order of a few hundred words (a few KB of text). Vendors like Microsoft and Adobe release advisories in bulk on Patch Tuesday (monthly), whereas others (Cisco, Oracle, VMware, etc.) publish advisories whenever needed or on a quarterly schedule. So, one could gather hundreds of vendor advisories per year across major vendors. Over time, this corpus can grow to many MBs of text (e.g. Microsoft’s monthly bulletins alone over years amount to thousands of entries).
- Update frequency: varies by vendor – some have regular patch cycles (e.g. Oracle quarterly, Microsoft monthly), others sporadic. Scraping tips: Vendor advisory pages come in varied formats. Some are simple HTML tables of CVEs; others are PDFs or require navigating HTML with expandable sections. Many vendors provide RSS feeds or JSON APIs for recent advisories – using those can simplify collection. When scraping HTML, watch out for quirks like JavaScript-required content or login gates (some vendors require a free login to view older advisories). Rate limiting is crucial; hitting a vendor site too fast may trigger bans. It’s wise to respect
robots.txtand use cached datasets if available. Licensing: Generally, vendor advisories are public information intended for broad dissemination (no specific license, but implicitly free to redistribute for security purposes). Still, check if any vendor imposes usage terms on their advisory portal. Typically, quoting or using the text for research is fine.
- Security Mailing Lists: Forums like Full Disclosure, Bugtraq (historic), and oss-security are rich sources of raw vulnerability information, exploit dumps, and discussions among researchers.
- Size: Mailing list posts range from short notices to very long threads. A single email might be 1–5 KB of text on average (though some include lengthy code/exploit attachments). Over decades, lists like Full Disclosure have accumulated tens of thousands of posts (Full Disclosure started in 2002 and has been running for 20+ years). For example, a year of Full Disclosure might be a few MB of text (hundreds of posts, each a few KB). The entire archive could be on the order of ~50–100 MB (millions of words) if collected. Frequency: These lists see new posts daily or weekly, depending on industry activity. Full Disclosure and oss-security often have multiple posts per day when active vulnerabilities are being discussed.
- Scraping tips: Many mailing list archives are available via Pipermail or HyperMail HTML indexes. For instance, oss-security is archived monthly on Openwall, and Full Disclosure is archived on seclists.org. Scraping Pipermail archives requires iterating over monthly archive pages (which may be HTML or gzipped text). One approach is to fetch the index of months, then download each month (handling
.txt.gzfiles on the fly). Watch out for rate limits – seclists.org and others might block rapid access, so introduce delays or fetch during off-peak hours. Additionally, be aware that some emails include PGP signatures or attachments (which appear as blocks of base64 text); you might want to strip those to avoid large irrelevant token blobs. It’s also helpful to remove duplicate emails (the same post might be cross-posted to multiple lists). Licensing/Etiquette: Mailing list content is public domain in spirit (anyone can subscribe and redistribute), though it’s polite to attribute the list and author if you quote content. No formal license is attached to emails, but for a model dataset, simply note the source (e.g., “Includes posts from the Full Disclosure mailing list”).
- Security Blogs and Reports: A plethora of security blogs (by companies and individuals) provide narrative explanations of threats, vulnerabilities, and incidents. These include blog sites of security vendors (Kaspersky, Symantec, Palo Alto Unit42, etc.), independent researchers (e.g. Google Project Zero blog), and news sites (Krebs on Security, BleepingComputer, The Hacker News).
- Size: Blog posts are typically a few hundred to a few thousand words each. A single blog article might be ~2–5 pages of text (let’s say 1–3 KB of text, or 200–800 tokens). If you aggregate dozens of blogs over years, this easily reaches hundreds of MB. For instance, threat intel reports (like annual reports from security companies) are often released as PDFs that can be 1–5 MB each (with text, charts, etc., equating to maybe 5k–10k words). Update frequency: varies by source – some corporate blogs post weekly, researcher blogs whenever a new discovery is made, news sites daily. To cover comprehensively, you’d periodically scrape new posts (some feeds update daily/weekly).
- Scraping tips: Many blogs provide an RSS feed, which is the easiest way to get new posts in a structured XML format. Use RSS where available to avoid HTML quirks. When scraping HTML, note that different CMS platforms have different structures (WordPress blogs have
<article>tags and class names you can target, Medium.com blogs have a generic HTML that might need rendering, etc.). Also, some sites (like Medium or certain news sites) load content dynamically; a simple request might not get the full text. Tools like readability libraries or using a headless browser might help extract the main content. Rate limiting is again important – hitting a news site with hundreds of pages quickly can trigger defenses. Try to use official archives or sitemap files if provided. - Quality considerations: These narrative sources are high-quality in terms of prose and context, which is great for a language model. Just be mindful to remove any embedded media captions or boilerplate (e.g. “About the author” sections) that aren’t useful. Licensing: Blog content is typically copyrighted by the author or publisher. For training data, this falls under fair use in research most likely, but from a curation perspective, it’s “restricted” compared to the open data above. If the model is non-commercial or if you have permission, you can include it. Otherwise, you may need to filter out content from sources that explicitly forbid scraping. In practice, many security researchers want their write-ups widely read, so as long as you’re not redistributing verbatim, using it for model training is usually acceptable.
- Academic Research Papers: Academic publications in computer security (e.g. papers from IEEE Security & Privacy, USENIX Security, ACM CCS, NDSS, arXiv preprints) provide in-depth, peer-reviewed content on software vulnerabilities, cryptography, malware, etc.
- Size: Papers average around 10 pages of two-column PDF. That equates to roughly 5,000–10,000 words (which is ~25k–50k tokens) per paper. If you gather say 500 papers, that’s on the order of 3–5 million tokens. Top conferences have ~50–150 papers each year, so over a decade that’s thousands of papers. The entire corpus of security research (if including all workshops, journals, etc.) could be tens of thousands of papers, but practically, one might select a few thousand most relevant ones for ~hundreds of millions of tokens at most. Update frequency: Conferences happen annually; new papers come year-round across venues. arXiv preprints for security (cs.CR and cy) are updated daily. So new research content is continuous, but in bursts around conference deadlines.
- Scraping tips: Academic texts are primarily in PDF form. Scraping them means downloading PDFs and extracting text. PDF extraction has pitfalls: text may be in two columns (you need a parser that merges columns correctly), and there are often formulas, tables, and references that can clutter the text. A good pipeline is to use tools like GROBID or science-parse to get structured text from PDFs, or rely on arXiv’s TeX sources when available. Also, consider focusing on sections like Abstract, Introduction, Discussion for training (which are more narrative), and perhaps skipping large math sections that might not benefit a security language model. Rate limiting: if pulling from arXiv or publishers, be gentle (arXiv allows bulk via its OAI-PMH API, which is worth using).
- Licensing: Many papers are behind paywalls, but authors often share preprints. Prefer open-access versions (arXiv, institutional repositories) to avoid legal issues. Academic papers might be © the publisher; including them in training is generally covered by fair use (as transformative use for model training), but it’s a gray area. If possible, limit to open-access (CC BY or similar) papers. In any case, since the user asks for both open and restricted content, including them is on the table – just flag internally that they’re copyrighted.
3. Exploit Code Corpora (Exploit-DB, Metasploit, GitHub PoCs)
- Exploit-DB: The Exploit Database is a public archive of exploits and proofs-of-concept, maintained by Offensive Security. It contains thousands of exploit codes across various platforms.
- The language mix in Exploit-DB is diverse: many exploits for memory corruption or local privilege escalation are in C/C++ (source code that needs compilation), a good number of Python and Perl scripts for remote exploits or automation, quite a few PHP or ASP code snippets for web exploits, shell scripts and bash one-liners for Unix local exploits, as well as raw shellcode (often as assembly or hex bytes). There are also Ruby exploits (older Metasploit modules) and some PowerShell or VBA for Windows. Essentially, if a programming language can be used to exploit something, Exploit-DB likely has examples. This means a model trained on it sees multiple languages and even non-standard code (e.g., exploit docs with proprietary language snippets). For instance, to successfully run Exploit-DB PoCs, one “must know programming languages like C, C++, Python, bash and so on”.
- Data access: Exploit-DB provides a web interface and also an offline package (the
searchsploittool and archive). For scraping, one approach is to use the Exploit-DB RSS feed for new exploits, or crawl the exploit pages (each exploit has an ID and page). The site lists the code (often with a “Download” link). You can also clone the Exploit-DB GitHub repo which contains all exploits organized by platform. - Cleaning considerations: Exploit-DB entries may include not just code but also a description or usage notes as comments. When preparing data, it’s useful to retain those comments (they provide context) but ensure they’re distinguishable from code (maybe keep the comment markers). Remove any HTML artifacts from the web pages if scraping directly.
- Metasploit Modules: The Metasploit Framework has an extensive set of exploit modules (and auxiliary modules), primarily written in Ruby. Incorporating Metasploit code provides many curated exploits with consistent structure (each module has metadata, a
checkmethod, anexploitmethod, etc.).- Language mix: Almost all modules are Ruby, but within them you might find embedded C code or assembly (for custom payloads), and references to Python or PowerShell if the exploit uploads a script to the target. Including Metasploit means your dataset is heavy on Ruby syntax. Access: Metasploit is open source (BSD-3-Clause License). You can pull the
rapid7/metasploit-frameworkGitHub repo to get all modules. Note there are >2000 exploit modules. Each is a text file (~few KB to tens of KB). The total size of all Metasploit Ruby files is on the order of 10 MB. Cleaning: Since Metasploit modules are well-structured, little cleaning is needed beyond removing git artifacts. But you might want to strip out large data blobs (some modules include encoded shellcode or long byte arrays). Also, consider that many modules are similar (e.g. repeated code for common tasks); de-duplicate or at least be aware of this so as not to over-weight certain patterns.
- Language mix: Almost all modules are Ruby, but within them you might find embedded C code or assembly (for custom payloads), and references to Python or PowerShell if the exploit uploads a script to the target. Including Metasploit means your dataset is heavy on Ruby syntax. Access: Metasploit is open source (BSD-3-Clause License). You can pull the
- Proof-of-Concept code on GitHub: Outside of official databases, researchers often publish PoC exploits on GitHub or GitLab repos. For example, after a big CVE is announced, you’ll see multiple repos named like “CVE-2021-XXXXX” with exploit code.
- These can be in any language – commonly Python or C, but also Go, JavaScript (Node), PowerShell, etc., depending on the target environment. Collecting these PoCs can greatly expand coverage of recent exploits (including many “niche” ones that aren’t in Exploit-DB).
- Access: Searching GitHub by CVE identifier is a straightforward way (GitHub’s code search or using the GH Archive dataset). There are also projects that aggregate PoCs (e.g., some folks maintain lists of exploit PoC links). Keep in mind rate limiting on the GitHub API and respect it (or use the GraphQL API which can batch queries).
- Cleaning: PoC repos might contain multiple files, README instructions, etc. For training, the exploit code itself is primary, but accompanying README text can provide valuable context. It’s wise to remove unrelated files (like huge binary payloads or pcap dumps sometimes included). Also, verify the license of each repo – many are just “public domain” or MIT, but if any have restrictive licenses, you might skip those. In general, small snippets on GitHub intended as PoCs are meant to be shared freely.
- Cleaning Steps for Safe Inclusion: When adding exploit code to a training set, special care is needed to keep the data useful but not accidentally harmful or problematic:
- Neutralize harmful payloads: If an exploit contains an actual malicious payload (e.g. a reverse shell shellcode), consider replacing the raw shellcode bytes with a token like “[SHELLCODE]” or at least truncating it. This way the model sees that shellcode exists but doesn’t learn the exact bytes to replicate (which could be considered dual-use dangerous). Similarly, remove any hardcoded malware binary blobs.
- Strip credentials or personal info: Some exploit samples have hardcoded credentials or API keys (perhaps from a testing scenario). Remove or anonymize those (e.g. replace with
<USER>). - Limit extremely long auto-generated content: Exploit code sometimes includes huge arrays or strings (for example, a 10000-character NOP sled, or a large chunk of hex for a payload). These can blow up the token count and don’t teach the model much beyond “a long string of repeated data”. You can truncate such strings or replace them with a shorter representative sequence plus a comment
/* truncated */. This keeps sequence lengths reasonable and avoids wasting model capacity on learning long no-op patterns. - Ensure encoding consistency: Convert files to UTF-8 text. Non-ASCII bytes (some exploits are in binary form or have non-printable chars) should be either removed or escaped (e.g.,
\x90style escapes for shellcode bytes) so that the data stays textual. - Comment context: If you decide to include exploit code, it’s helpful to also include any comments or metadata (e.g., the title, CVE number, author name). This gives the model context (so it knows this piece of code is an exploit for CVE-X). You might format it as a comment at the top of the code snippet.
- Legal and ethical filter: Excluding exploit code that is extremely dangerous or not publicly known might be prudent. However, all content we consider here is publicly available (“in the wild”). The main ethical consideration is what the model might do with it. That leads to red-team filtering (discussed below) – essentially, filtering or flagging content that could cause the model to output unduly harmful instructions. For example, if an exploit is essentially a step-by-step guide to hacking a live service, you might question including it verbatim. In general, focus on exploit code and technical details intended for defensive security researchers, and avoid content that’s purely a how-to for crime.
4. Threat-Intel Knowledge Bases (STIX/TAXII, MISP, CAPEC)
- STIX (Structured Threat Information eXpression): STIX is a standardized ontology for cyber threat intelligence. It defines a set of domain objects (SDOs) and relationship objects (SROs) to represent things like Indicators (malicious observable patterns), Threat Actors, Attack Campaigns, Tools/Malware, Vulnerabilities, etc.. Each STIX object has a type and a schema. For example, an Indicator has fields:
pattern(e.g. an IOC pattern like an IP or file hash),pattern_type(such as STIX’s own pattern language or Sigma),valid_fromdate, etc. A Vulnerability object might have a name and description and commonly an external reference to a CVE ID. STIX’s ontology is extensive (it can even capture relationships like uses, attributed-to between actors and tools). Mapping to CVE/CWE: STIX did not create new vulnerability or weakness IDs; instead it leverages external references. For instance, a STIX Vulnerability object typically just links to the CVE ID (in theexternal_referencesfield with source_name “CVE”). Similarly, STIX objects can reference CWE IDs if needed (e.g., an Attack Pattern could have an external reference to a CWE weakness or CAPEC entry). Essentially, STIX provides the container and you populate it with CVE/CWE as references.- Access & Format: STIX 2.x is JSON-based; threat intel feeds from various sources (like MITRE ATT&CK, some ISAOs) are provided as STIX bundles. TAXII (Trusted Automated Exchange of Intelligence Information) is the protocol to query and share STIX data over HTTPS. You might ingest STIX by connecting to a TAXII server (for example, MITRE’s TAXII for ATT&CK, or other community feeds) or by importing JSON collections. For training data, STIX is useful as structured JSON text that the model can learn from (e.g., understanding the format of an Indicator or that a Threat Actor “aliases” field might contain names). Ensure the model sees enough examples so it can recognize this format. License: STIX is an OASIS standard – free to use. Specific STIX feeds (like ATT&CK’s) carry the license we discussed (ATT&CK’s open terms). Other STIX feeds from commercial intel might have restrictions, but you wouldn’t include those without permission. Use openly available STIX examples (there are many on OASIS site and in GitHub repos) for training.
- TAXII: While not a data source itself, TAXII is the API/transport for STIX data. If you use TAXII feeds, you’ll get STIX objects. For completeness: TAXII 2.1 defines endpoints to collections of STIX objects (e.g., “Enterprise ATT&CK threat actors”), and allows filtering by date or type. In context of a model, you might include some raw TAXII JSON responses as part of the data to teach the model the format, but it’s essentially the same content (STIX). The important ontology piece is that TAXII organizes data into collections, and doesn’t introduce new fields beyond STIX. Mapping: TAXII doesn’t alter CVE/CWE mapping – it just delivers STIX content that contains those references.
- MISP (Malware Information Sharing Platform): MISP is an open-source threat intel sharing platform widely used by CERTs and communities. It has its own data model, which can be seen as an ontology for events and indicators. The core concept is a MISP Event, which is like a container for information about a threat or incident. Each event has metadata (timestamp, threat level, info, tags) and contains
- Attributes and/or Objects. An Attribute is a single datum (like an IP address, domain, hash, email, etc.) with a type (MISP has a fixed taxonomy of attribute types). An Object is a composite of attributes defined by a template (for example, a “Person” object might have attributes name, role, affiliation; a “Vulnerability” object might have attributes like CVE, CWE, affected CPE, etc.).
- Key fields and ontology: MISP attributes have a
category(e.g. Network activity, Payload installation) and atype(e.g. “ip-src”, “domain”, “malware-sample”, “vulnerability”). Notably, MISP has a vulnerability object template that includes fields for CVE ID, CWE ID, CVSS score, etc.. So, in MISP you might represent a vuln by adding an object with “cve-id: CVE-2023-XXXX” and maybe “cwe-id: CWE-79” attributes. - Mapping to CVE/CWE: As just described, MISP events can directly include CVE IDs as attributes or part of vulnerability objects. This makes mapping straightforward – if your model reads MISP JSON export, it will see CVE IDs in a field called e.g.
valuewith type “vulnerability”. For CWE, MISP doesn’t enforce CWE usage, but analysts can include CWE references (perhaps via free-text in description or as a tag from a MISP taxonomy). There is also a MISP taxonomy for weaknesses and attack techniques that could indirectly map CWE/CAPEC. - Access: MISP data is usually shared in communities, not publicly dumped (due to sensitive nature). However, there are sample datasets and MISP feeds (some open OSINT feeds) in JSON format. A MISP JSON export contains an array of events with all attributes. For training, you could include sanitized MISP data to teach the model the JSON structure and how indicators are described.
- License: MISP software is BSD licensed, and the data – if from open feeds – might be considered open data. But often it’s community-contributed with no formal license. For our purposes, any public MISP feed (like abuse.ch or Botvrij.eu feeds) can be used. Just be cautious not to include private MISP data.
- CAPEC (Common Attack Pattern Enumeration and Classification): CAPEC is a structured dictionary of attack patterns – it’s like the counterpart to CWE (which is weaknesses) and closely related. Each CAPEC entry describes a method of attack (e.g. SQL Injection, DNS Tunneling) including fields like a description of the technique, typical severity, prerequisites for the attack, potential consequences, and mitigations. CAPEC also lists Related Weaknesses, which are CWE IDs that the attack exploits or requires. For example, CAPEC-100 (Buffer Overflow) will have related weakness CWE-119 (memory buffer overflow vulnerability). It may also have Examples of real-world attacks (sometimes referencing specific CVEs or incidents as instances of that pattern).
- Data format: CAPEC, like CWE, is published by MITRE. It’s available as XML (with a schema similar to CWE’s) and on the CAPEC website. The schema includes the fields mentioned: e.g.
<Attack_Pattern id="CAPEC-100">with child elements for Description, RelatedWeaknesses (list of CWE IDs), Likelihood, Severity, Mitigations, etc. CAPEC is hierarchical too (some patterns are children of others). - Mapping to CVE/CWE: Direct mapping to CVEs is not common (CVE entries usually don’t list CAPEC). However, you can map CVEs to CAPEC via CWE: a CVE has a CWE (e.g. CVE-2017-7269 has CWE-119), and that CWE is linked to CAPEC-100 (as per CAPEC’s Related Weaknesses). Thus, if the model knows CWE and CAPEC, it can conceptually connect a vulnerability to relevant attack patterns. CAPEC itself explicitly maps to CWE (and vice versa, CWE entries often list related CAPECs in their XML).
- Access: Download the CAPEC XML or use MITRE’s CAPEC website (they might have a download similar to CWE’s). There are about ~500 CAPEC entries, so it’s not huge. Usage in training: Including CAPEC definitions will give the model knowledge of high-level attack techniques and terminology, which is useful for a security-focused LM (e.g., it could explain what “SQL Injection” means in terms of CAPEC).
- Licensing: As with CWE/CVE, MITRE’s terms allow free use for research/commercial with attribution. CAPEC content is under the same style of terms (essentially public, just credit MITRE).
- Summary of Mapping: Each of these knowledge bases links together:
- STIX can reference CVE IDs through external_references, and can include CWE IDs similarly.
- MISP can have CVE as an attribute and use CWE in its vulnerability object or as a tag.
- CAPEC ties to CWE, which ties to CVE. In practice, to get CAPEC for a CVE: find the CVE’s CWE, then look up which CAPECs list that CWE as a related weakness.
- Also, ATT&CK (from section 1) can map to these: some ATT&CK techniques cite CAPEC references, and some tools in ATT&CK have CVE references for vulnerabilities they exploit, etc. If needed, the model can learn those linkages.
5. Recommended Curation Pipeline
Building a 10-billion-token domain-specific corpus requires careful curation to maximize quality and coverage. Below is a recommended pipeline with key steps:
- Data Collection & Format Normalization: First, gather data from all the above sources (structured and unstructured). Convert everything into a consistent text format. For example, parse JSON feeds (CVE, etc.) into flattened JSON lines or another serialized form (or keep as JSON, but ensure newlines and indentation are consistent). Convert HTML from blogs/advisories to plain text (stripping navigation, ads, etc.), perhaps using an HTML-to-text tool. Extract text from PDFs (academic papers) using a reliable PDF miner, and possibly clean up LaTeX artifacts. Aim to retain useful content and meta-information (like section titles, CVE IDs, etc.) while removing boilerplate.
- Deduplication: De-duping is essential in cybersecurity data because the same vulnerability can appear in multiple sources. For instance, a CVE description from MITRE, an NVD entry, and a vendor advisory might all be nearly identical text. Similarly, an exploit may be reposted on multiple forums. Use hashing or similarity checking to remove duplicate or near-duplicate texts. One approach is to compute a fuzzy hash (like simhash) for each document and drop those that are too similar. Deduping can significantly reduce the corpus size but improves the quality by preventing the model from over-counting certain information. (It also helps reduce overfitting to specific phrasings.) For reference, large LM datasets like The Pile performed extensive deduplication for quality. In our context, ensure that if the exact same advisory text appears from two sources, it’s only kept once. Minor caveat: if two sources have the same core text but one adds analysis (e.g., NVD vs a blog), you might keep the added parts but not repeat the core. This can be done by splitting into chunks and deduplicating at chunk level.
- Content Filtering (Policy and Red-Team): Apply red-team filtering to remove or tag content that could be problematic. Since this is a security model, we do want it to know about malware and exploits – but we don’t want it to regurgitate dangerous instructions verbatim or facilitate misuse. A balanced approach:
- Filter out any explicitly sensitive personal data (unlikely in vuln data, but if any emails or names that are not public figures show up, consider removing).
- Filter or redact credentials, API keys, or server addresses in data dumps (to avoid training the model on live secrets).
- Look for content that is purely how-to-crack without defensive context. For example, a tutorial titled “How to hack wifi step-by-step” might cross a line. If such content exists in the data and is not providing new technical insight, exclude it. We want the model to explain vulnerabilities, not be a script kiddie toolkit.
- Use profanity or toxicity filters for general cleanliness – security forums can sometimes contain strong language or insults. These are not central to technical capability, so it’s reasonable to drop highly toxic messages.
- Large language models have been found to sometimes memorize and regurgitate code, especially if it’s seen many times. By filtering some of the most directly harmful pieces (like actual exploit code for an actively dangerous 0-day if present), you reduce the chance the model will output them on prompt. Since our corpus is mostly public/disclosed vulns, this risk is lower, but the filtering is still good practice.
- One can employ open-source safety classifiers to flag content (for hate, self-harm, sexual, etc.). Likely not much of that in vuln data, but if using some hack forum dumps, it might appear. Remove those as they’re irrelevant to infosec tasks.
- Red-team testing: After an initial round of filtering, it’s valuable to simulate adversarial prompts on a smaller model or a data sample – e.g., see if a prompt like “give me step-by-step to exploit X” finds exact answers in the data. If yes, consider if that portion of the data should be pruned or rephrased. The idea is to make the model robust and safe by curating what goes in.
- Tokenization quirks: Be mindful of how your tokenizer (BPE, WordPiece, etc.) will handle the content. Security text has lots of special patterns: hex strings (
0x90), memory addresses, stack traces, snippets of code with indentations, URLs, etc. Some tokenizers might split these into many small tokens. For example, a base64 blob can become thousands of individual tokens (AAAA...repeated gets broken up). Very long strings of single characters (like a long sequence ofAin an exploit) can produce unnecessarily long token sequences. Two mitigations:- Pre-filter or truncate long uninterpretable strings as mentioned. E.g., limit repeated characters.
- Possibly add common tokens to the tokenizer vocabulary (if you can) for things like “CVE-” or common hex patterns, so that they don’t all split character-by-character. If that’s not feasible, at least be aware that the model might see “CVE-2023-1234” as several tokens (“CVE”, ”-”, “2023”, ”-”, “1234”) – which is fine. It will likely learn the pattern anyway.
- Structuring and Metadata: It can help to include subtle prompts/metadata in the training text to let the model know the context. For example, precede a CVE record with a line like “CVE Record:\n” or format it in YAML/JSON explicitly. Or for exploit code, you might add a comment “# Exploit for CVE-XXXX”. These little cues, when consistent, become tokens the model can use to identify the type of content. This isn’t strictly necessary but can improve the model’s ability to differentiate between a code snippet vs. a narrative vs. a list of fields.
- Balancing and Mixing: In a 10B-token run, you need to decide how to mix the sources. Some sources are relatively small (e.g., CAPEC XML is tiny compared to mailing list corpus). You likely will upsample the smaller but important sources so that they aren’t completely drowned out by larger text sources. For instance, you might repeat the CAPEC and CWE data multiple times in the epoch so the model sees those patterns enough. Conversely, extremely large sources (if you had one source that was, say, 70% of data) might be downsampled to avoid bias. Aim for a blend that covers all needed knowledge evenly.
- Token Count Estimates: Based on the sources described, the total tokens readily available may be on the order of only a few hundred million, so reaching 10 billion tokens requires augmentation or repetition:
- Structured data (CVE, CWE, CAPEC, ATT&CK, KEV, OSV JSON): likely <50M tokens combined. For example, ~200k CVEs * ~100 tokens each on average = 20M tokens; CWE descriptions maybe a couple million; ATT&CK JSON maybe a few million.
- Narrative data (vendor advisories, blogs, lists, papers): Let’s say you collect 100k blog posts/news articles averaging 500 tokens each = 50M tokens. Mailing list archives, maybe another 20–50M (depending on how much you include). Academic papers: 5k papers * 10k tokens each = 50M. So combined narrative might be ~100–150M tokens if aggressively collected.
- Exploit code corpora: Suppose 10k exploits at 300 tokens each average = 3M tokens; Metasploit ~2M; PoCs maybe 5M. Very roughly, code exploits might be <10M tokens.
- Replicate/augment: You could repeat the corpus multiple times (which is common in domain adaptive pretraining since domain data is limited). Repeating it ~40 times would give ~8–12B tokens. This ensures the model gets a lot of exposure to the domain data, though repeated exposure runs the risk of some overfitting or model “memorization” of quirks. Mitigate by slight shuffling or adding noise each epoch.
- Expand sources: Include more peripheral data. For instance, include general IT forums (Stack Exchange Security Q&As), or larger IT manuals. However, ensure relevance – including too much generic data dilutes the “security focus”. Another idea is to incorporate translated versions (if multilingual ability is desired, but likely not if focusing English).
- Efficient tokenization: Ensure your tokenizer is not inflating token count unnecessarily on things like hex dumps. If you can reduce tokens per input while retaining info (by smarter tokenization), you effectively get more content in 10B tokens.
- Verification and QA: After curation, it’s good to manually inspect random samples of the processed data. Make sure the formatting looks right (JSON is not broken, code blocks are intact, no weird encoding issues like
\ufeffor HTML entities left unconverted). Also verify that deduplication worked (no obvious duplicates of CVE text or identical exploits). If you have the resources, try running a smaller language model on the data and see if it learns the basics (this can catch issues early). - Documentation: Keep an audit trail of what you included, especially for licensed content (like CC-BY sources from OSV/GitHub). For any CC-BY, you should document attribution in your project (e.g., “This dataset includes data from the GitHub Advisory Database © GitHub, used under CC BY 4.0.”). Also document any filtering you did (for transparency and for future adjustments).
By following this pipeline – collect → normalize → deduplicate → filter → tokenize → balance – you’ll end up with a comprehensive and relatively clean 10B-token dataset tailored for cybersecurity. The model trained on this should have wide knowledge from low-level exploits up to high-level attack patterns, while also being guided by safe-data principles from the filtering stage.
6. Glossary
- CVE: Common Vulnerabilities and Exposures. A unique identifier for a publicly disclosed cybersecurity vulnerability. CVEs are issued by CVE Numbering Authorities and tracked in the CVE List (e.g., CVE-2025-12345 refers to a specific vulnerability).
- CWE: Common Weakness Enumeration. A categorized list of software/hardware weakness types (bugs in code or design that can lead to vulnerabilities). E.g., CWE-79 is Cross-Site Scripting. CWEs describe classes of flaws.
- CVSS: Common Vulnerability Scoring System. A standard method to score the severity of a vulnerability (usually on a 0–10 scale). CVSS scores are based on factors like ease of exploit, impact, etc., and are often given as a vector string (e.g., AV:N/AC:L/… etc.).
- ATT&CK: Adversarial Tactics, Techniques, and Common Knowledge. A framework by MITRE detailing the tactics (goals) and techniques (methods) used by adversaries in cyber attacks. Each Technique has an ID (Txxxx) and describes how attackers accomplish a certain step (like credential dumping).
- KEV: Known Exploited Vulnerabilities (Catalog). A compilation maintained by CISA of vulnerabilities that are known to have been exploited in the wild, often used to prioritize patching. Sometimes called “CISA KEV List”.
- OSV: Open Source Vulnerabilities. In context, refers to the OSV database which aggregates security advisories for open-source projects in a unified format. Also the JSON schema used by that database.
- STIX: Structured Threat Information eXpression. A standardized language (JSON-based) for describing cyber threat intelligence entities like indicators, threat actors, malware, campaigns, etc., and their relationships. Enables sharing of threat data between organizations.
- TAXII: Trusted Automated Exchange of Intelligence Information. A protocol for exchanging CTI (often STIX-formatted) over HTTPS. Defines how clients request collections of STIX objects from servers. Essentially, an API for threat intel feeds.
- MISP: Historically “Malware Information Sharing Platform” (now just “MISP Threat Sharing”). An open-source platform/tool for sharing threat intel, including IOCs (Indicators of Compromise) and forensic info. MISP also refers to the data format it uses (events with attributes/objects).
- CAPEC: Common Attack Pattern Enumeration and Classification. A MITRE-maintained list of common attack techniques/patterns used by adversaries, each with an ID (CAPEC-xxx) and a detailed description. Pairs with CWE (attack patterns exploit weaknesses).
- DAPT: Domain-Adaptive Pre-Training. The process of taking a pre-trained language model and further training it on domain-specific data (here, security text) to adapt it to that domain. For example, starting with a general model and doing additional passes on infosec data to improve its security expertise.
- RSS: Really Simple Syndication. A feed format (XML) that websites (including many security blogs and vendor portals) provide to syndicate their content updates. Used for scraping new posts or advisories easily.
- IOC: Indicator of Compromise. An artifact or piece of data that suggests a system may be compromised. Examples: an IP address of a C2 server, a file hash of malware, a domain name used in phishing. (MISP and STIX heavily deal with IOCs.)
- JSON: JavaScript Object Notation. A text-based data format often used for APIs and data interchange. Many security datasets (CVE, STIX, OSV) use JSON to structure information (key:value pairs, arrays, etc.).
- CSV: Comma-Separated Values. A simple tabular text format where fields are separated by commas. Some feeds (like KEV or older CWE lists) can be downloaded as CSV files for easy import.
- PII: Personally Identifiable Information. Data that can identify a specific individual (names, emails, addresses, etc.). Mentioned in context of cleaning to ensure no sensitive PII is unintentionally included from sources. In security datasets, PII might appear in mailing list posts (e.g., researcher names, emails).
- MITRE: The MITRE Corporation – a U.S. non-profit organization that maintains CVE, CWE, CAPEC, and ATT&CK. (Not an acronym in this context, but often appears in discussions of these datasets.)
- NVD: National Vulnerability Database. A U.S. government (NIST) database built on the CVE list, providing additional info like CVSS scores, CWE classifications, and CPE (product identifiers). (Included here as it’s often mentioned alongside CVE/CVSS).
- CNA: CVE Numbering Authority. An entity authorized to assign CVE IDs for vulnerabilities in a certain scope (e.g., a vendor can be a CNA for its products). Appears in CVE JSON data as part of record metadata.
- IOC: Indicator of Compromise. Mentioned in threat intel context (duplicate of earlier IOC definition, included for completeness because it’s a key concept in CTI).