BR Validators is a 100% open-source validation library (MIT). Security issues in validation logic are critical — a false positive/negative on CPF/CNPJ undermines every downstream system.
| Version | Supported |
|---|---|
Latest stable (1.x) |
Yes |
Previous minor (1.(x-1)) |
Security fixes only |
Pre-1.0 (0.x) |
Best effort during alpha/beta |
Unreleased main |
Fix forward; no backports unless critical |
See docs/VERSIONING.md for release and support policy.
Do not open a public GitHub issue for security vulnerabilities.
- Go to github.com/AlexandreZanata/br-validators/security/advisories
- Click Report a vulnerability
- Describe the issue with reproduction steps and impact
Official guidance: GitHub — Privately reporting a security vulnerability
If GitHub advisories are unavailable, email the maintainers with subject [SECURITY] br-validators:
- Include steps to reproduce
- Affected version(s)
- Impact assessment (e.g. incorrect CNPJ validation accepts invalid input)
| Severity | Acknowledge | Initial assessment | Target fix | CVE |
|---|---|---|---|---|
| Critical | 48 hours | 5 business days | Patch ≤ 72 h after official spec confirm | Requested when applicable |
| High | 48 hours | 5 business days | Patch ≤ 7 days | Requested when applicable |
| Medium | 5 business days | 10 business days | Next patch/minor | Maintainer discretion |
| Low | 10 business days | — | Next minor | Unlikely |
When official agencies (RFB, Bacen) change algorithms, we treat misalignment as High minimum until patched.
CVE issuance follows GitHub repository security advisories.
| In scope | Out of scope |
|---|---|
| Incorrect check-digit algorithm (false accept/reject) | Bugs in consumer apps using this library |
| ReDoS or catastrophic backtracking in regex validators | Social engineering |
| Supply-chain issues in released package tarballs | Vulnerabilities in devDependencies only (see Dependency audit) |
| Documentation that leads to insecure integration | Missing features (use feature requests) |
| Severity | Example | Target fix |
|---|---|---|
| Critical | Valid CNPJ rejected / invalid CNPJ accepted at scale | Patch release ≤ 72h after official spec confirmation |
| High | Wrong behavior on edge case with official test vector | Patch release ≤ 7 days |
| Medium | Non-security correctness bug | Next patch/minor |
| Low | Documentation or DX issue with security implication | Next minor |
- Coordinated disclosure — we request 90 days before public disclosure unless fix is released sooner.
- Credit given in CHANGELOG.md and GitHub advisory (unless reporter prefers anonymity).
- CVE requested for Critical/High when applicable.
Every push to main / developing and every pull request runs .github/workflows/ci.yml:
| Scope | Command | Policy |
|---|---|---|
Runtime (dependencies in published packages) |
pnpm audit --prod --audit-level=high |
Fail CI on high or critical |
| Dev (tooling, test, docs site) | pnpm audit --audit-level=high |
Warn only — does not block merge |
Use pnpm audit (not bare npm audit at repo root) — lockfile is pnpm-lock.yaml.
References: pnpm audit · npm audit
- Confirm the advisory applies to code paths we ship (
@br-validators/corehas zero runtime npm dependencies). - Prefer upgrade — bump the vulnerable package in
pnpm-lock.yamlviapnpm update <pkg>and re-runpnpm verify. - pnpm overrides — only when upstream has no patch; set in both
package.json#pnpm.overrides(pnpm 9 lockfile) andpnpm-workspace.yaml(pnpm 11+ CI audit). Document in CHANGELOG.md and.local/security-audit.mdwith review date. - Dev-only high — if the finding is in Vitest/VitePress/playground tooling with no production path, track in
.local/security-audit.md; CI warns but does not fail.
Maintainers re-run pnpm audit --prod --audit-level=high before every release tag (also enforced in Release workflow via pnpm verify).
| Control | Implementation |
|---|---|
| No registry publish | pnpm publish blocked everywhere by scripts/assert-ci-publish.mjs; no npm token exists in the repository |
| Frozen lockfile | pnpm install --frozen-lockfile in CI and Release |
| Version gate | Release workflow verifies git tag matches all six package.json versions |
| Checksums | Every asset is listed in SHA256SUMS; catalog.json carries a SHA-256 per embedded data file |
| Self-contained manifests | scripts/build-release-artifacts.ts points workspace: dependencies at the sibling tarball of the same release (no registry resolution) |
| Least privilege | Release uses the built-in GITHUB_TOKEN with contents: write only |
Published runtime packages (@br-validators/core, adapters) bundle no third-party runtime deps — supply-chain risk is primarily publish pipeline integrity, not transitive npm deps in the tarball.
See docs/BRANCHING.md and docs/SECURITY-PRACTICES.md.
- No network I/O in core validators (reduces attack surface)
- Golden test vectors from official sources
- All contributions must be MIT-compatible — see docs/OPEN-SOURCE.md
Contributors must not include:
- Real CPF/CNPJ numbers from production databases in tests (use synthetic/official examples only)
- Secrets, API keys, or
.envfiles - Code under incompatible licenses
See CONTRIBUTING.md.