We actively support the following versions of PJS with security updates:
| Version | Supported | Notes |
|---|---|---|
| 0.8.x | ✅ | Current stable release (recommended) |
| 0.7.x | ❌ | Unsupported - upgrade to 0.8.x |
| < 0.7 | ❌ | Unsupported - upgrade to 0.8.x |
Recommendation: Always use the latest patch version within the supported major.minor release.
- Current Release: Receives all security updates, bug fixes, and feature updates
- Previous Patch Releases: Security fixes backported for critical vulnerabilities (CVSS >= 7.0)
- EOL Versions: No security support - users must upgrade
Rust toolchain: pjson-rs requires nightly Rust (no MSRV; rust-toolchain.toml pins a dated nightly). pjson-rs-domain and pjs-wasm have an MSRV of Rust 1.89.
We take security seriously. If you discover a security vulnerability in PJS, please report it responsibly.
DO NOT create a public GitHub issue for security vulnerabilities.
Preferred Method: GitHub Security Advisories
- Go to https://github.com/bug-ops/pjs/security/advisories
- Click "Report a vulnerability"
- Fill out the advisory form with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Affected versions
What to Include:
- Description: Clear explanation of the vulnerability
- Reproduction: Step-by-step instructions to reproduce
- Impact: Potential security impact (confidentiality, integrity, availability)
- Affected Versions: Which versions are vulnerable
- Suggested Fix: Proposed remediation (optional)
- Proof of Concept: Code or steps demonstrating the issue (if applicable)
- Your Information: Name and contact details (for credit and follow-up)
We are committed to responding promptly:
| Timeframe | Action |
|---|---|
| 24 hours | Initial acknowledgment of your report |
| 72 hours | Preliminary assessment and triage (CVSS scoring) |
| 7 days | Detailed response with timeline for fix |
| 30 days | Security patch released (for critical vulnerabilities) |
| 60 days | Public disclosure (coordinated with reporter) |
Critical Vulnerabilities (CVSS >= 9.0):
- Hotfix released within 7 days
- Immediate notification to known users
- Emergency security advisory published
High Severity (CVSS 7.0-8.9):
- Patch released within 30 days
- Included in next regular release or emergency patch
Medium/Low Severity (CVSS < 7.0):
- Fix included in next scheduled release
- Documented in CHANGELOG.md
We follow responsible disclosure practices:
- Private Discussion: We work with you privately to understand and fix the issue
- Patch Development: We develop and test a fix
- Security Advisory: We prepare a security advisory draft
- Coordinated Release: We coordinate public disclosure with you
- Credit: We give you credit in the security advisory (unless you prefer to remain anonymous)
Disclosure Timeline:
- Default: 90 days from initial report
- Extended on request if fix is complex
- Accelerated for actively exploited vulnerabilities
Stay informed about security updates:
- GitHub Security Advisories: https://github.com/bug-ops/pjs/security/advisories
- GitHub Watch: Enable "Releases only" or "All activity" notifications
- Changelog: Review
CHANGELOG.mdfor security fixes - Cargo Audit: Run
cargo auditregularly in your projects
Subscribe to Updates:
# Add PJS to your dependency audit
cargo install cargo-audit
cargo audit
# Check for advisories specifically for PJS
cargo audit --db cargo-advisory-dbThe following are in scope for security vulnerability reports:
Core Library (pjson-rs):
- Memory safety violations (buffer overflows, use-after-free)
- Denial of Service (DoS) attacks
- Decompression bombs
- Excessive memory allocation
- Infinite loops or excessive CPU usage
- Stack overflow from deeply nested JSON
- Input validation bypass
- Schema validation bypass
- Integer overflow/underflow
- Unsafe code vulnerabilities
WebAssembly (pjs-wasm):
- WASM memory safety issues
- JavaScript interop vulnerabilities
- WASM-specific DoS vectors
- Security limit bypass
HTTP/WebSocket Servers:
- Authentication/authorization bypass
- CORS misconfiguration exploitation
- Header injection
- Request smuggling
- WebSocket protocol violations
Security Features:
- Rate limiting bypass
- Compression bomb protection bypass
- Depth tracking bypass
- Size limit bypass
The following are not considered security vulnerabilities:
- Vulnerabilities in dependencies (report to the upstream project)
- Performance issues without security impact
- Feature requests or enhancements
- Issues in demo applications (
pjs-demo, examples) - Third-party integrations (unless PJS code is vulnerable)
- Social engineering attacks
- Physical security
- Denial of service requiring significant resources (e.g., 1000+ servers)
Exceptions:
- Dependency vulnerabilities affecting PJS will be tracked and addressed
- We monitor our dependencies with
cargo-auditand will update vulnerable dependencies
Production Deployment:
create_pjs_router() allows only http://localhost:3000 and requires no authentication; it is for local development. In production, build the router from an explicit HttpServerConfig, add authentication, and serve it with serve_with_limits, which enforces connection-level limits (header read timeout, connection lifetime, connection and per-IP caps) and a graceful shutdown drain:
use pjson_rs::infrastructure::http::{
ConnectionLimits, HttpServerConfig, ShutdownConfig, create_pjs_router_with_auth,
auth::{ApiKeyAuthLayer, ApiKeyConfig},
serve_with_limits,
};
let config = HttpServerConfig::new(vec!["https://app.example.com".to_string()]);
let auth = ApiKeyAuthLayer::new(ApiKeyConfig::new(&["my-api-key"])?);
let router = create_pjs_router_with_auth(&config, auth)?.with_state(app_state);
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?;
serve_with_limits(listener, router, ConnectionLimits::default(), ShutdownConfig::default()).await?;The router already applies a 10 MB request body limit, a request timeout and a global concurrency cap. ConnectionLimits::default() closes connections after 300 seconds; a listener that serves WebSocket routes must set max_connection_duration to None.
WASM Security Limits:
import { PjsParser, PriorityStream, SecurityConfig } from '@pjson/wasm';
const security = new SecurityConfig()
.setMaxJsonSize(5 * 1024 * 1024) // 5 MB max
.setMaxDepth(32) // 32 levels max
.setMaxArrayElements(10000) // 10K elements max
.setMaxObjectKeys(10000); // 10K keys max
const parser = PjsParser.withSecurityConfig(security);
const stream = new PriorityStream();
stream.setSecurityConfig(security);- Validate Input: Always validate JSON size before processing
- Set Limits: Configure appropriate depth, size, and count limits
- Use Latest Version: Keep PJS updated to the latest patch version
- Audit Dependencies: Run
cargo auditregularly - Rate Limiting: Implement rate limiting for public endpoints
- Error Handling: Don't expose sensitive information in error messages
- Monitor Resources: Track memory and CPU usage
- Timeouts: Set appropriate timeouts for parsing and streaming
PJS includes defense-in-depth security:
Decompression Protection (v0.4.7+):
- MAX_RLE_COUNT: 100,000 items per run-length encoded segment
- MAX_DELTA_ARRAY_SIZE: 1,000,000 elements in delta-encoded arrays
- MAX_DECOMPRESSED_SIZE: 10 MB total output (stream decompression)
- Integer overflow protection: Checked arithmetic throughout
Parsing Limits:
- Max JSON depth: 64 levels (configurable; in the WASM bindings this truncates deeper structure to
nullrather than rejecting the input, unlike the limits below) - Max JSON size: 10 MB (configurable, rejected on excess)
- Max array elements: 10,000 (configurable, rejected on excess — enforced at every nesting level)
- Max object keys: 10,000 (configurable, rejected on excess — enforced at every nesting level)
Rate Limiting:
- Configurable per-session and global limits
- Automatic cleanup of expired sessions
- Bounded memory usage
Connection and Memory Bounds:
serve_with_limitscaps connections (1024 total, 64 per source IP by default), header read time (10 s) and connection lifetime (300 s)- WebSocket servers enforce per-IP connection, message-rate and frame-size limits (
RateLimitConfig) and a write timeout against peers that stop reading - The aligned
BufferPoolenforces a total memory budget (max_total_memory) and fails allocations that exceed it - The only
unsafecode (parser::buffer_pool,parser::aligned_alloc) is checked under Miri in CI
v0.4.7 (2026-01-25) - Decompression Vulnerabilities Fixed
Fixed 3 critical vulnerabilities in decompression algorithms:
-
VULN-001: RLE Decompression Bomb (CVSS 7.5 → 0.0)
- Unlimited run-length encoding could exhaust memory
- Fixed: MAX_RLE_COUNT limit (100,000 items)
-
VULN-002: Delta Array Size Validation (CVSS 7.5 → 0.0)
- Delta decompression could create unbounded arrays
- Fixed: MAX_DELTA_ARRAY_SIZE limit (1,000,000 elements)
-
VULN-003: Integer Overflow in Delta Decompression (CVSS 7.5 → 0.0)
- Integer overflow in cumulative delta calculation
- Fixed: Checked arithmetic with overflow protection
Affected Versions: 0.3.x - 0.4.6 Fixed In: 0.4.7 Mitigation: Upgrade to 0.4.7 or later
We maintain a history of security issues in our changelog. See CHANGELOG.md for details.
Our CI pipeline includes:
- OSV Scanner: Vulnerability scanning on pull requests and merge groups, plus weekly on Saturdays at 17:39 UTC
- Cargo Deny: Advisory, license and source checks for the workspace and the fuzz crate
- Clippy: Static analysis with warnings denied
- Miri: Memory-safety checks of the
unsafebuffer pool code - Fuzzing: Committed seeds replayed on every relevant change; each target explored for 60 seconds weekly
- Codecov: Code coverage monitoring
We conduct periodic security reviews:
- Code review for all PRs
- Architecture review for major changes
- Dependency audit before releases
- Penetration testing for HTTP/WebSocket features (on request)
We appreciate security researchers who help us keep PJS secure. Contributors who responsibly disclose vulnerabilities will be acknowledged here (with permission).
Contributors:
- (None yet - be the first!)
- Rust Security Database: https://rustsec.org/
- OWASP Top 10: https://owasp.org/www-project-top-ten/
- CWE (Common Weakness Enumeration): https://cwe.mitre.org/
- CVE (Common Vulnerabilities and Exposures): https://cve.mitre.org/
If you have questions about this security policy, please contact:
- Email: k05h31@gmail.com
- GitHub Discussions: https://github.com/bug-ops/pjs/discussions
Thank you for helping keep PJS and its users secure!