stix2-validator
APIs and scripts for validating STIX 2.x documents.
What it is and what it does
The STIX Validator is a tool for checking that STIX JSON content conforms to the STIX 2.1 specification. It validates documents against both mandatory "MUST" requirements—using JSON schemas and Python functions for checks that cannot be expressed in schema alone—and recommended "SHOULD" best-practice requirements. The validator distinguishes between these two requirement types, allowing users to ignore best-practice checks if needed. It also color-codes output to make validation results easier to interpret at a glance.
The package works as both a command-line script (stix2_validator) and a library that can be integrated into other tools. Users can validate JSON files, JSON strings, or Python dictionaries representing STIX objects. It is maintained as an OASIS TC Open Repository under BSD-3-Clause licensing, with active governance and community participation.
Use it for:
- Validate STIX threat intelligence documents before ingestion into security platforms or databases.
- Integrate STIX validation into CI/CD pipelines to enforce specification compliance in automated threat data workflows.
- Check STIX JSON files for both mandatory conformance and best-practice adherence during threat intelligence authoring.
- Build custom security tools that need to verify STIX object structure and content before processing.
- Audit existing STIX document collections for specification violations and best-practice gaps.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates STIX 2.x JSON documents against the STIX 2.1 specification, checking both mandatory requirements via JSON schemas and recommended best practices via Python functions.
Yes. The package is actively maintained, has low install friction, carries a permissive license, and fills a clear need for STIX 2.x validation in threat intelligence workflows. No known vulnerabilities and broad Python version support (3.10–3.14) make it a safe, reliable choice for projects requiring STIX conformance checking.
Install
stix2-validator on PyPI
pip
pip install stix2-validatoruv
uv add stix2-validatorpoetry
poetry add stix2-validatorInstalling stix2-validator
Before you install
Low friction install with 7 common runtime dependencies and a pure-Python wheel distribution. Actively maintained with a recent release 94 days ago and ongoing repository activity.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install stix2-validator
from stix2validator import validate_file, print_results
results = validate_file("stix_file.json")
print_results(results)
Requires Python 3.10 or later.
Verify before relying
- Whether the validator supports custom STIX objects when the type-checking option is disabled.
- Performance characteristics when validating large STIX document collections.
- Whether all STIX 2.1 specification updates are covered in the current release.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — colorama, cpe, jsonschema, python-dateutil, requests, simplejson, stix2-patterns |
| Maintenance | actively maintained — 94 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,440/month — #11,034 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stix2_validator-3.3.1-py2.py3-none-any.whl
Keywords: stix, stix2, json, validation, validator, stix-validator, stix2-validator
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
stix2Serializes and deserializes STIX 2 JSON…
permissive · top 5,000 on PyPI
stix2-patternsValidates the syntax of STIX 2 Pattern…
permissive · top 5,000 on PyPI
stixParses, manipulates, and generates STIX v1.2.0…
permissive · top 15,000 on PyPI
swagger-spec-validatorValidates Swagger/OpenAPI specifications…
permissive · top 15,000 on PyPI
taxii2-clientA minimal client library for querying and…
permissive · top 15,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
flexValidates Swagger 2.0 API specifications…
permissive · top 15,000 on PyPI
kcidb-iokcidb-io validates and manipulates Linux Kernel…
copyleft · top 15,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI
compliance-trestleCompliance-trestle manages, validates, and…
permissive · top 15,000 on PyPI