websec-validator 0.18.0__tar.gz → 0.19.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {websec_validator-0.18.0/src/websec_validator.egg-info → websec_validator-0.19.0}/PKG-INFO +22 -7
- {websec_validator-0.18.0 → websec_validator-0.19.0}/README.md +21 -6
- {websec_validator-0.18.0 → websec_validator-0.19.0}/pyproject.toml +1 -1
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/calibration.json +1 -1
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/cli.py +30 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/crypto_usage.py +19 -2
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/pii_exposure.py +33 -4
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/webext.py +115 -11
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/findings.py +85 -1
- {websec_validator-0.18.0 → websec_validator-0.19.0/src/websec_validator.egg-info}/PKG-INFO +22 -7
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator.egg-info/SOURCES.txt +4 -0
- websec_validator-0.19.0/tests/test_detector_fp_followups.py +189 -0
- websec_validator-0.19.0/tests/test_explained_brief.py +333 -0
- websec_validator-0.19.0/tests/test_ignore_claimspec.py +231 -0
- websec_validator-0.19.0/tests/test_pii_projection_fp.py +72 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/LICENSE +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/setup.cfg +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/__init__.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/agenthook.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/attest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/attribution.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/baseline.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/briefing.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/calibration.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/clusters.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/constitution.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/corpus.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/coverage.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/dast_ingest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/dast_predict.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/demo.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/diffscope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/dynamic.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/enrichment.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/explain.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/__init__.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/agent_config.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/auth.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/authz.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/authz_dataflow.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/base.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/client_exposure.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/client_integrity.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/dependencies.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/django_urls.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/graphql.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/iac_ci.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/integrations.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/llm_security.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/policy_consistency.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/profiles.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/routes.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/schemas.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/sql_flow.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/stack.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/surface.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/syntax.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/tenant.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/transport_security.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/upload_security.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/feedback.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/fixprompt.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/formats.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/fpfilter.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/gate.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/graph_enrich.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/hooks.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/init_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/install.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/intel.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/inventory.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/mcp_server.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/openapi.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/pairs.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/probes.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/proof.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/provenance.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/recon.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/registry.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/repairs.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/report.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/research/control-scope-cases.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/research/example.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/research/profile-cases.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/research.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/rules/error-stack-disclosure.yml +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/rules/insecure-default-secret.yml +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/sarif_ingest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/scanners.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/schemas/coverage.schema.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/schemas/facts.schema.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/schemas/ledger.schema.json +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/synthetic.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/demo/app.py.txt +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/demo/requirements.txt.txt +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/_lib.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/appsync-cswsh.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/appsync-introspection.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/appsync-subscription-bola.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/bola-cross-tenant.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/bola-write-verbs.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/client-integrity-checklist.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/compare-roles.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/dlp-bypass-offline.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/entitlement-abuse.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/error-disclosure-probe.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/forged-token.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/hs256-brute-force.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/jwt-attacks.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/mass-assignment.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/password-reuse.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/pii-output-diff.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/race-conditions.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/rate-limit-burst.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/s3-assess.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/ssrf-probes.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/unauth-baseline.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/upload-matrix.sh +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/probes/webhook-forgery.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/reports/FINDINGS-SUMMARY.md.template +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/reports/access-control-matrix.md.template +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/reports/findings-triage.md.template +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/reports/pentest-handover-brief.md.template +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/templates/reports/per-tool-FINDINGS.md.template +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/testplan.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator.egg-info/dependency_links.txt +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator.egg-info/entry_points.txt +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator.egg-info/top_level.txt +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_action_contracts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_adoption_contracts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_agent_hook.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_agent_hosts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_agent_launch_specs.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_analysis_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_assurance_regressions.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_attest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_attribution.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_auth_control_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_calibration_claimspec.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_calibration_review.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_calibration_scoring.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_constitution.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_control_scope_research.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_coverage.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_crypto_comparisons.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_dast_ingest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_dast_predict.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_demo.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_detector_precision.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_diffscope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_django_routes.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_dynamic_login_shape.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_enrichment.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_entitlement_webext.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_evidence_verdicts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_explain.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_extension_controls.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_feedback.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_feedback_calibration_loop.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_field_report_2026_09.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_fixprompt_fpfilter.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_formats.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_fp_sources.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_gate_and_bypass_record.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_gate_command.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_gitleaks_worktree.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_graph_enrich.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_hardening.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_hooks.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_hooks_contracts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_install.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_install_contracts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_intel.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_inventory.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_issue_147_sarif_locations.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_lifecycle.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_mcp.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_mcp_security.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_openapi.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_output_boundaries.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_pentest_regressions.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_profiles.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_proof_revisions.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_provenance.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_public_precision.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_read_boundary.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_read_performance.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_recon.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_registry_existence.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_remaining_control_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_research.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_research_cli.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_sarif_ingest.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_sarif_workbench.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_scanner_contracts.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_source_budget.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_sql_flow.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_stack_metadata.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_synthetic_pairs.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_testplan.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_transport_pii_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_transport_stack_scope.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_triage.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_unanalyzed_cli.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_unanalyzed_coverage.py +0 -0
- {websec_validator-0.18.0 → websec_validator-0.19.0}/tests/test_workbench_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: websec-validator
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.0
|
|
4
4
|
Summary: Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app.
|
|
5
5
|
Author: Ricardo Accioly
|
|
6
6
|
License: MIT
|
|
@@ -49,6 +49,12 @@ A senior pentester's "here's what to test and how" handoff — auto-generated fr
|
|
|
49
49
|
|
|
50
50
|
[](assets/demo.gif)
|
|
51
51
|
|
|
52
|
+
**New here?** Read the eight-page technical brief — what it reads, how a finding earns its severity,
|
|
53
|
+
what it refuses to say, and the field evidence:
|
|
54
|
+
**[raccioly.github.io/websec-validator](https://raccioly.github.io/websec-validator/websec-explained.html)**
|
|
55
|
+
· [PDF](https://raccioly.github.io/websec-validator/websec-explained.pdf). Every number in it is
|
|
56
|
+
asserted against this tree by `tests/test_explained_brief.py`, so it cannot drift silently.
|
|
57
|
+
|
|
52
58
|
It is *not* an autonomous scanner and *not* a SaaS. It's the missing front-half: the thing that
|
|
53
59
|
turns a repo into a precise, fact-grounded security brief an AI agent (with a human in the loop)
|
|
54
60
|
can act on — an auto-filled, repo-aware version of a senior pentester's "here's what to test and
|
|
@@ -128,12 +134,15 @@ No need to install Noir or the scanners separately — the image carries a worki
|
|
|
128
134
|
```bash
|
|
129
135
|
docker build -t websec-validator .
|
|
130
136
|
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out
|
|
137
|
+
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out --scan # …and execute the bundled scanners
|
|
131
138
|
```
|
|
132
139
|
|
|
133
140
|
The image carries Noir + Trivy + Gitleaks + Semgrep + Checkov — not the full list above, so
|
|
134
141
|
OSV-Scanner, Prowler and the per-language SAST tools (Bandit, gosec, Brakeman) are absent and are
|
|
135
|
-
reported as missing rather than silently skipped.
|
|
136
|
-
|
|
142
|
+
reported as missing rather than silently skipped. **Bundling them is not the same as running them:**
|
|
143
|
+
Noir is the route engine and runs on every `run`, but the four static scanners execute only under
|
|
144
|
+
`--scan` — a plain `run` lists them and prints `(add --scan to execute them)`, exactly as it does
|
|
145
|
+
outside Docker. Mount your repo at `/scan`; artifacts land in `/scan/websec-out`.
|
|
137
146
|
|
|
138
147
|
## Usage
|
|
139
148
|
|
|
@@ -697,8 +706,9 @@ add the matching dated changelog and migration guidance, and validate the combin
|
|
|
697
706
|
In the 0.x series, feature additions or incompatible contracts increment the minor version.
|
|
698
707
|
|
|
699
708
|
After reviewing current main and overlapping PRs, merge the approved release PR only after its
|
|
700
|
-
required CI checks pass. The resulting main commit subject must be `release:
|
|
701
|
-
|
|
709
|
+
required CI checks pass. The resulting main commit subject must be `release: v<version>`, where
|
|
710
|
+
`<version>` is whatever `pyproject.toml` currently declares — do not hard-code a number here, it
|
|
711
|
+
drifts. [release-tag.yml](.github/workflows/release-tag.yml) validates that subject against the
|
|
702
712
|
package version, creates the matching tag/GitHub Release, and explicitly dispatches
|
|
703
713
|
[publish.yml](.github/workflows/publish.yml) at that tag. A version edit alone does not publish.
|
|
704
714
|
|
|
@@ -713,7 +723,7 @@ omit an independent version field. Check both sources when diagnosing stale inst
|
|
|
713
723
|
|
|
714
724
|
## Status / roadmap
|
|
715
725
|
|
|
716
|
-
Version 0.
|
|
726
|
+
Version 0.18.0 provides 22 recon extractors, eleven optional scanner entries, nine named profiles,
|
|
717
727
|
SARIF import/export, bounded source/query analysis, explicit coverage and lifecycle evidence,
|
|
718
728
|
intelligence/research commands, and opt-in agent/hook/CI adoption. It adds an in-loop security gate
|
|
719
729
|
(`websec gate` and a `PostToolUse` hook), analysis scoping with `--only`, an opt-in dependency
|
|
@@ -725,7 +735,12 @@ in-loop gate is developer ergonomics, not a control, and `attest` reports eviden
|
|
|
725
735
|
rendering a compliance verdict.
|
|
726
736
|
|
|
727
737
|
The [0.14.0 migration guide](docs/MIGRATING-0.14.0.md) explains schema 2.0 and gate/artifact
|
|
728
|
-
changes. 0.16.0
|
|
738
|
+
changes. 0.16.0 added the claimspec calibration export over 0.15.3 and needed no migration.
|
|
739
|
+
0.17.0 split the exit codes (`2` = usage error, `3` = incomplete run) — the one breaking change in the
|
|
740
|
+
project's history; CI scripts that tested for `2` as "incomplete" must test for `3`. 0.17.1 changed no
|
|
741
|
+
behaviour: it corrected only what the tool says about itself.
|
|
742
|
+
0.18.0 adds a measured `P(real)` from a relabelled corpus, and stops a scan that could read no
|
|
743
|
+
analyzable source from reporting as a completed clean run (`--require-analyzed`, exit 3).
|
|
729
744
|
The [remaining-work specification](specs/001-continuous-security-improvement/spec.md) consolidates
|
|
730
745
|
unresolved gaps and acceptance tests so overlapping old-base PRs do not become competing roadmaps.
|
|
731
746
|
Existing runtime probes are opt-in; their earlier isolated results are not current deployment proofs.
|
|
@@ -20,6 +20,12 @@ A senior pentester's "here's what to test and how" handoff — auto-generated fr
|
|
|
20
20
|
|
|
21
21
|
[](assets/demo.gif)
|
|
22
22
|
|
|
23
|
+
**New here?** Read the eight-page technical brief — what it reads, how a finding earns its severity,
|
|
24
|
+
what it refuses to say, and the field evidence:
|
|
25
|
+
**[raccioly.github.io/websec-validator](https://raccioly.github.io/websec-validator/websec-explained.html)**
|
|
26
|
+
· [PDF](https://raccioly.github.io/websec-validator/websec-explained.pdf). Every number in it is
|
|
27
|
+
asserted against this tree by `tests/test_explained_brief.py`, so it cannot drift silently.
|
|
28
|
+
|
|
23
29
|
It is *not* an autonomous scanner and *not* a SaaS. It's the missing front-half: the thing that
|
|
24
30
|
turns a repo into a precise, fact-grounded security brief an AI agent (with a human in the loop)
|
|
25
31
|
can act on — an auto-filled, repo-aware version of a senior pentester's "here's what to test and
|
|
@@ -99,12 +105,15 @@ No need to install Noir or the scanners separately — the image carries a worki
|
|
|
99
105
|
```bash
|
|
100
106
|
docker build -t websec-validator .
|
|
101
107
|
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out
|
|
108
|
+
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out --scan # …and execute the bundled scanners
|
|
102
109
|
```
|
|
103
110
|
|
|
104
111
|
The image carries Noir + Trivy + Gitleaks + Semgrep + Checkov — not the full list above, so
|
|
105
112
|
OSV-Scanner, Prowler and the per-language SAST tools (Bandit, gosec, Brakeman) are absent and are
|
|
106
|
-
reported as missing rather than silently skipped.
|
|
107
|
-
|
|
113
|
+
reported as missing rather than silently skipped. **Bundling them is not the same as running them:**
|
|
114
|
+
Noir is the route engine and runs on every `run`, but the four static scanners execute only under
|
|
115
|
+
`--scan` — a plain `run` lists them and prints `(add --scan to execute them)`, exactly as it does
|
|
116
|
+
outside Docker. Mount your repo at `/scan`; artifacts land in `/scan/websec-out`.
|
|
108
117
|
|
|
109
118
|
## Usage
|
|
110
119
|
|
|
@@ -668,8 +677,9 @@ add the matching dated changelog and migration guidance, and validate the combin
|
|
|
668
677
|
In the 0.x series, feature additions or incompatible contracts increment the minor version.
|
|
669
678
|
|
|
670
679
|
After reviewing current main and overlapping PRs, merge the approved release PR only after its
|
|
671
|
-
required CI checks pass. The resulting main commit subject must be `release:
|
|
672
|
-
|
|
680
|
+
required CI checks pass. The resulting main commit subject must be `release: v<version>`, where
|
|
681
|
+
`<version>` is whatever `pyproject.toml` currently declares — do not hard-code a number here, it
|
|
682
|
+
drifts. [release-tag.yml](.github/workflows/release-tag.yml) validates that subject against the
|
|
673
683
|
package version, creates the matching tag/GitHub Release, and explicitly dispatches
|
|
674
684
|
[publish.yml](.github/workflows/publish.yml) at that tag. A version edit alone does not publish.
|
|
675
685
|
|
|
@@ -684,7 +694,7 @@ omit an independent version field. Check both sources when diagnosing stale inst
|
|
|
684
694
|
|
|
685
695
|
## Status / roadmap
|
|
686
696
|
|
|
687
|
-
Version 0.
|
|
697
|
+
Version 0.18.0 provides 22 recon extractors, eleven optional scanner entries, nine named profiles,
|
|
688
698
|
SARIF import/export, bounded source/query analysis, explicit coverage and lifecycle evidence,
|
|
689
699
|
intelligence/research commands, and opt-in agent/hook/CI adoption. It adds an in-loop security gate
|
|
690
700
|
(`websec gate` and a `PostToolUse` hook), analysis scoping with `--only`, an opt-in dependency
|
|
@@ -696,7 +706,12 @@ in-loop gate is developer ergonomics, not a control, and `attest` reports eviden
|
|
|
696
706
|
rendering a compliance verdict.
|
|
697
707
|
|
|
698
708
|
The [0.14.0 migration guide](docs/MIGRATING-0.14.0.md) explains schema 2.0 and gate/artifact
|
|
699
|
-
changes. 0.16.0
|
|
709
|
+
changes. 0.16.0 added the claimspec calibration export over 0.15.3 and needed no migration.
|
|
710
|
+
0.17.0 split the exit codes (`2` = usage error, `3` = incomplete run) — the one breaking change in the
|
|
711
|
+
project's history; CI scripts that tested for `2` as "incomplete" must test for `3`. 0.17.1 changed no
|
|
712
|
+
behaviour: it corrected only what the tool says about itself.
|
|
713
|
+
0.18.0 adds a measured `P(real)` from a relabelled corpus, and stops a scan that could read no
|
|
714
|
+
analyzable source from reporting as a completed clean run (`--require-analyzed`, exit 3).
|
|
700
715
|
The [remaining-work specification](specs/001-continuous-security-improvement/spec.md) consolidates
|
|
701
716
|
unresolved gaps and acceptance tests so overlapping old-base PRs do not become competing roadmaps.
|
|
702
717
|
Existing runtime probes are opt-in; their earlier isolated results are not current deployment proofs.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "websec-validator"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.19.0"
|
|
8
8
|
description = "Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"caveat": "indicative \u2014 calibrated on a deliberately-vulnerable app corpus; skews optimistic on clean production code",
|
|
25
25
|
"evidence_status": "reviewed",
|
|
26
26
|
"reviewed_on": "2026-09-22",
|
|
27
|
-
"limitation": "21 of 56 corpus findings carry a reviewed label; the other 35 are UNKNOWN and are excluded from every count rather than treated as false.
|
|
27
|
+
"limitation": "21 of 56 corpus findings carry a reviewed label; the other 35 are UNKNOWN and are excluded from every count rather than treated as false. All per-class cells except missing-auth|MEDIUM (n=7) are below min_n=5, so every other class falls back to the per-label tier. Measured after the 2026-09-22 false-positive fixes (vendored assets, spec-as-handler, Express route middleware, displayed source), so these rates describe the current detector and not any earlier one."
|
|
28
28
|
},
|
|
29
29
|
"by_class_label": {
|
|
30
30
|
"command-injection|LOW": {
|
|
@@ -229,6 +229,33 @@ def cmd_init(args) -> int:
|
|
|
229
229
|
said. Proposals are evidence-based and always printed before anything is written."""
|
|
230
230
|
from . import init_scope
|
|
231
231
|
target = _resolve_target(args.target)
|
|
232
|
+
# --claimspec: export the REVIEWED acknowledgements ALREADY in .websec-ignore as a claimspec v1
|
|
233
|
+
# `ignore` document (the Guard-family shared format). This reads policy instead of scaffolding
|
|
234
|
+
# it, so it short-circuits before any proposal is computed and never writes .websec-ignore.
|
|
235
|
+
if getattr(args, "claimspec", None):
|
|
236
|
+
doc, report = findings.to_claimspec_ignore(target)
|
|
237
|
+
payload = json.dumps(doc, indent=2, sort_keys=False) + "\n"
|
|
238
|
+
if args.claimspec == "-":
|
|
239
|
+
sys.stdout.write(payload)
|
|
240
|
+
else:
|
|
241
|
+
dest = Path(args.claimspec).expanduser().resolve()
|
|
242
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
243
|
+
dest.write_text(payload)
|
|
244
|
+
print(f"websec init --claimspec: wrote {dest} — {report['entries']} entr(y/ies)")
|
|
245
|
+
# The omissions are the whole point of reporting at all: a claimspec `ignore` document that
|
|
246
|
+
# silently dropped half the policy would read to an auditor as the complete one. They go to
|
|
247
|
+
# stderr so `--claimspec -` stays a clean pipe.
|
|
248
|
+
if not report["complete"]:
|
|
249
|
+
print(" NOT the complete suppression policy:", file=sys.stderr)
|
|
250
|
+
if report["omitted_patterns"]:
|
|
251
|
+
print(f" {report['omitted_patterns']} path/category pattern(s) omitted — a bare "
|
|
252
|
+
".websec-ignore pattern carries\n no reason, and claimspec requires one; "
|
|
253
|
+
"inventing one would make an unreviewed\n suppression read as reviewed.",
|
|
254
|
+
file=sys.stderr)
|
|
255
|
+
for row in report["omitted_acknowledgements"]:
|
|
256
|
+
print(f" acknowledgement {row['fingerprint']} omitted "
|
|
257
|
+
f"({row['state']}): {row['why']}", file=sys.stderr)
|
|
258
|
+
return EXIT_OK
|
|
232
259
|
proposal = init_scope.propose(target)
|
|
233
260
|
print(f"websec-validator v{__version__} — scope setup for {target}\n")
|
|
234
261
|
if proposal["entries"]:
|
|
@@ -1650,6 +1677,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1650
1677
|
help="print the proposed .websec-ignore without writing it")
|
|
1651
1678
|
i.add_argument("--force", action="store_true",
|
|
1652
1679
|
help="replace an existing .websec-ignore (it may hold reviewed acknowledgements)")
|
|
1680
|
+
i.add_argument("--claimspec", metavar="PATH",
|
|
1681
|
+
help="export the reviewed `fingerprint:` acknowledgements already in "
|
|
1682
|
+
".websec-ignore as a claimspec v1 `ignore` document; `-` writes to stdout")
|
|
1653
1683
|
i.set_defaults(func=cmd_init)
|
|
1654
1684
|
|
|
1655
1685
|
d = sub.add_parser("doctor", help="show which scanners are installed")
|
{websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/crypto_usage.py
RENAMED
|
@@ -99,8 +99,14 @@ def _unparenthesized(value: str) -> str:
|
|
|
99
99
|
return value
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
# Identifier-shaped arguments: not credentials, so hashing them weakly is not a password-hash bug.
|
|
103
|
+
_NON_CREDENTIAL_ARGUMENT = re.compile(r"(?:^|\.)(?:id|email|userId|user_id|tenantId|tenant_id)$", re.I)
|
|
104
|
+
|
|
105
|
+
|
|
102
106
|
def _credential_operand(value: str) -> bool:
|
|
103
107
|
# Literal words in arbitrary message strings aren't credential variables.
|
|
108
|
+
if re.search(r'\.(?:length|size|byteLength|type)$', value):
|
|
109
|
+
return False
|
|
104
110
|
bare = re.sub(_TIMING_LITERAL, "''", value)
|
|
105
111
|
if _CREDENTIAL_NAME.search(bare):
|
|
106
112
|
return True
|
|
@@ -112,7 +118,7 @@ def _credential_operand(value: str) -> bool:
|
|
|
112
118
|
|
|
113
119
|
def _presence_literal(value: str, suffix: str) -> bool:
|
|
114
120
|
value = _unparenthesized(value)
|
|
115
|
-
if value in {"''", '""'}:
|
|
121
|
+
if value in {"''", '""', '0', '"0"', "'0'"}:
|
|
116
122
|
return True
|
|
117
123
|
if suffix == ".py":
|
|
118
124
|
return value in {"None", "True", "False"}
|
|
@@ -244,7 +250,18 @@ class CryptoUsageExtractor(Extractor):
|
|
|
244
250
|
arg_start = end + update.end()
|
|
245
251
|
arg_end = expression_end(body, arg_start-1, closing=")")
|
|
246
252
|
argument = body[arg_start:arg_end-1].strip()
|
|
247
|
-
|
|
253
|
+
# A PKCE verifier is hashed by design, and an identifier is not a
|
|
254
|
+
# credential: `md5(user.id)` inside a password-ish function is a cache key,
|
|
255
|
+
# not a password hash. Hashing an identifier to MINT a token is a different
|
|
256
|
+
# bug (predictable token), not this one, so it is skipped here rather than
|
|
257
|
+
# reported under a class that would misdescribe it.
|
|
258
|
+
# These arguments CONTRIBUTE NOTHING; they must not clear a weak hash found
|
|
259
|
+
# earlier in the same function. Assigning False here instead let a later
|
|
260
|
+
# PKCE/identifier hash clobber a real `md5(password)` above it —
|
|
261
|
+
# test_pkce_exception_belongs_only_to_its_own_hash_argument catches exactly
|
|
262
|
+
# that, and the exception belongs to its own argument, not to the function.
|
|
263
|
+
if argument not in {"codeVerifier", "code_verifier"} \
|
|
264
|
+
and not _NON_CREDENTIAL_ARGUMENT.search(argument):
|
|
248
265
|
weak = True
|
|
249
266
|
if weak:
|
|
250
267
|
add("HIGH", "weak-password-hash", "weak-password-hash", rel,
|
{websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/pii_exposure.py
RENAMED
|
@@ -63,13 +63,42 @@ def _projected_binding(code: str, position: int, argument: str, scopes: list[dic
|
|
|
63
63
|
return False
|
|
64
64
|
body = code[scope["body_start"]:scope["end"]]
|
|
65
65
|
name = re.escape(argument)
|
|
66
|
-
if len(re.findall(r"\b" + name + r"\b", body)) != 2:
|
|
66
|
+
if len(re.findall(r"\b" + re.escape(name) + r"\b", body)) != 2:
|
|
67
67
|
return False
|
|
68
68
|
prefix = code[scope["body_start"]:position]
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
|
|
70
|
+
# Destructuring rest parameter: const { email, ...safeProfile } = user;
|
|
71
|
+
destruct_match = re.search(r"\b(?:const|let)\s*\{\s*([^}]*?)\.\.\.\s*" + re.escape(name) + r"\s*\}\s*=\s*[^;]+;", prefix)
|
|
72
|
+
if destruct_match:
|
|
73
|
+
destructured_fields = [f.strip() for f in destruct_match.group(1).split(",") if f.strip()]
|
|
74
|
+
if any(PII_FIELD.search(f) for f in destructured_fields):
|
|
75
|
+
return True
|
|
76
|
+
|
|
77
|
+
# Lodash omit equivalent: const safeAdmin = omit(admin, ['ssn', 'email']);
|
|
78
|
+
omit_match = re.search(r"\b(?:const|let)\s+" + re.escape(name) + r"\s*=\s*(?:_\.)?omit\s*\([^,]+,\s*\[(.*?)\]\s*\)", prefix)
|
|
79
|
+
if omit_match and bool(PII_FIELD.search(omit_match.group(1))):
|
|
80
|
+
return True
|
|
81
|
+
|
|
82
|
+
# Lodash pick equivalent: const safeAdmin = pick(admin, ['id', 'name']);
|
|
83
|
+
pick_match = re.search(r"\b(?:const|let)\s+" + re.escape(name) + r"\s*=\s*(?:_\.)?pick\s*\([^,]+,\s*\[(.*?)\]\s*\)", prefix)
|
|
84
|
+
if pick_match and not bool(PII_FIELD.search(pick_match.group(1))):
|
|
85
|
+
return True
|
|
86
|
+
|
|
87
|
+
# Array map destructuring: const safe = arr.map(({ pii, ...rest }) => rest)
|
|
88
|
+
map_destruct_match = re.search(r"\b(?:const|let)\s+" + re.escape(name) + r"\s*=\s*[\w$.]+\.map\s*\(\s*\(\s*\{\s*([^}]*?)\.\.\.\s*([A-Za-z_$][\w$]*)\s*\}\s*\)\s*=>\s*\2\s*\)\s*;", prefix)
|
|
89
|
+
if map_destruct_match:
|
|
90
|
+
destructured_fields = [f.strip() for f in map_destruct_match.group(1).split(",") if f.strip()]
|
|
91
|
+
if any(PII_FIELD.search(f) for f in destructured_fields):
|
|
92
|
+
return True
|
|
93
|
+
|
|
94
|
+
# Map projection to object literal: const safe = arr.map(u => ({ id: u.id }))
|
|
95
|
+
map_binding = re.search(r"\b(?:const|let)\s+" + re.escape(name) + r"\s*=\s*[\w$.]+\.map\s*\(\s*(?:[^)]+)\s*=>\s*\(?\s*(\{[^{}]*\})\s*\)?\s*\)\s*;", prefix)
|
|
96
|
+
binding = re.search(r"\bconst\s+" + re.escape(name) + r"\s*=\s*(\{[^{};]*\})\s*;\s*$", prefix)
|
|
97
|
+
|
|
98
|
+
match_literal = map_binding or binding
|
|
99
|
+
if not match_literal or in_literal(prefix, match_literal.start()):
|
|
71
100
|
return False
|
|
72
|
-
fields = split_arguments(
|
|
101
|
+
fields = split_arguments(match_literal.group(1)[1:-1])
|
|
73
102
|
return bool(fields) and all(re.fullmatch(r"[\w$]+\s*:\s*[\w$.]+", field)
|
|
74
103
|
and not PII_FIELD.search(field) for field in fields)
|
|
75
104
|
|
{websec_validator-0.18.0 → websec_validator-0.19.0}/src/websec_validator/extractors/webext.py
RENAMED
|
@@ -42,28 +42,132 @@ ON_MESSAGE_EXTERNAL = re.compile(r"\.onMessageExternal\.addListener")
|
|
|
42
42
|
BROAD_HOST = re.compile(r"<all_urls>|\*://\*/\*|https?://\*/\*")
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
# `const { origin } = sender;` before the guard is the common modern shape, and it was uncredited:
|
|
46
|
+
# `guarded_body` requires the body to START with `if (`, so any binding in front of the check made
|
|
47
|
+
# the whole handler read as unvalidated. That first-statement rule is deliberate and right — a guard
|
|
48
|
+
# that runs after something has already acted on untrusted input is too late — but a BINDING acts on
|
|
49
|
+
# nothing. So a prologue is allowed only when every statement in it is an inert alias of the sender,
|
|
50
|
+
# and the alias is then rewritten back to `sender.<prop>` so the existing predicate judges the real
|
|
51
|
+
# read rather than a name.
|
|
52
|
+
#
|
|
53
|
+
# Three things keep this from becoming a false negative:
|
|
54
|
+
# * only `const`/`let`/`var <name> = sender.<id|origin|url>` and `{ id, origin, url }` destructuring
|
|
55
|
+
# count — anything else in the prologue (a call, an await, an assignment to something else)
|
|
56
|
+
# abandons the rewrite and leaves the original, stricter behaviour,
|
|
57
|
+
# * an alias that is REBOUND anywhere in the body disqualifies the whole handler, because the value
|
|
58
|
+
# checked would not be the value used,
|
|
59
|
+
# * the prologue must be inert: no call, no await, no increment.
|
|
60
|
+
_ALIAS_PROP = r"(?:id|origin|url)"
|
|
61
|
+
_ALIAS_DESTRUCTURE = re.compile(
|
|
62
|
+
r"^(?:const|let|var)\s*\{\s*([^{}=;]+?)\s*\}\s*=\s*(\w[\w$]*)\s*;?$")
|
|
63
|
+
_ALIAS_ASSIGN = re.compile(
|
|
64
|
+
r"^(?:const|let|var)\s+([\w$]+)\s*=\s*(\w[\w$]*)\s*\??\.\s*(" + _ALIAS_PROP + r")\s*;?$")
|
|
65
|
+
_INERT = re.compile(r"""^[\w$\s{}:,.?\[\]'"=-]*$""")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _resolve_sender_aliases(body: str, sender: str) -> str:
|
|
69
|
+
"""Rewrite an inert alias prologue back to direct `sender.<prop>` reads, or return body unchanged.
|
|
70
|
+
|
|
71
|
+
Returns "" when an alias is rebound later — the caller must then refuse to credit, because the
|
|
72
|
+
value that was checked is not the value that gets used.
|
|
73
|
+
"""
|
|
74
|
+
statements, rest = [], body.strip()
|
|
75
|
+
aliases: dict = {}
|
|
76
|
+
while True:
|
|
77
|
+
head, sep, tail = rest.partition(";")
|
|
78
|
+
if not sep:
|
|
79
|
+
break
|
|
80
|
+
statement = head.strip()
|
|
81
|
+
if statement.startswith("if") or not statement:
|
|
82
|
+
break
|
|
83
|
+
if not _INERT.match(statement):
|
|
84
|
+
return body # a call/await ran before the guard: original rules
|
|
85
|
+
match = _ALIAS_ASSIGN.match(statement)
|
|
86
|
+
if match and match.group(2) == sender:
|
|
87
|
+
aliases[match.group(1)] = match.group(3)
|
|
88
|
+
else:
|
|
89
|
+
match = _ALIAS_DESTRUCTURE.match(statement)
|
|
90
|
+
if not match or match.group(2) != sender:
|
|
91
|
+
return body # an inert binding we cannot attribute to the sender
|
|
92
|
+
for part in match.group(1).split(","):
|
|
93
|
+
part = part.strip()
|
|
94
|
+
if not part:
|
|
95
|
+
continue
|
|
96
|
+
renamed = re.fullmatch(r"(" + _ALIAS_PROP + r")\s*:\s*([\w$]+)", part)
|
|
97
|
+
if renamed:
|
|
98
|
+
aliases[renamed.group(2)] = renamed.group(1)
|
|
99
|
+
elif re.fullmatch(_ALIAS_PROP, part):
|
|
100
|
+
aliases[part] = part
|
|
101
|
+
else:
|
|
102
|
+
return body # destructuring something other than the sender props
|
|
103
|
+
statements.append(statement)
|
|
104
|
+
rest = tail.lstrip()
|
|
105
|
+
if not aliases or not rest.startswith("if"):
|
|
106
|
+
return body
|
|
107
|
+
for alias in aliases:
|
|
108
|
+
rebind = re.compile(r"\b" + re.escape(alias) + r"\s*(?:=(?!=)|\+\+|--)")
|
|
109
|
+
if any(not in_literal(rest, m.start()) for m in rebind.finditer(rest)):
|
|
110
|
+
return "" # checked value != used value
|
|
111
|
+
rest = re.sub(r"\b" + re.escape(alias) + r"\b", f"{sender}.{aliases[alias]}", rest)
|
|
112
|
+
return rest
|
|
113
|
+
|
|
114
|
+
|
|
45
115
|
def _sender_control(scope: dict) -> bool:
|
|
46
116
|
if len(scope["params"]) < 2:
|
|
47
117
|
return False
|
|
48
118
|
sender = scope["params"][1]
|
|
49
|
-
body = scope["body"]
|
|
119
|
+
body = _resolve_sender_aliases(scope["body"], sender)
|
|
120
|
+
if not body:
|
|
121
|
+
return False # an alias was rebound after the check
|
|
50
122
|
# A check on an earlier value does not authorize a replaced sender object.
|
|
51
123
|
mutations = re.finditer(r"\b" + re.escape(sender) + r"(?:\.[\w$]+)?\s*(?:=(?!=)|\+\+|--)", body)
|
|
52
124
|
if any(not in_literal(body, match.start()) for match in mutations):
|
|
53
125
|
return False
|
|
54
126
|
|
|
55
127
|
def predicate(condition):
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
128
|
+
condition = condition.strip()
|
|
129
|
+
|
|
130
|
+
inverted = False
|
|
131
|
+
if condition.startswith("!"):
|
|
132
|
+
inverted = True
|
|
133
|
+
condition = condition[1:].strip()
|
|
134
|
+
if condition.startswith("(") and condition.endswith(")"):
|
|
135
|
+
condition = condition[1:-1].strip()
|
|
136
|
+
|
|
137
|
+
# `sender?.origin` as well as `sender.origin`: optional chaining is the same read.
|
|
138
|
+
# Deliberately NOT extended to local aliases (`const { origin } = sender`) — an alias can be
|
|
139
|
+
# reassigned between the binding and the check, and crediting one would turn a missing
|
|
140
|
+
# sender check into silence. Any extension needs a control proving a REASSIGNED alias is
|
|
141
|
+
# still reported.
|
|
142
|
+
sender_prop = re.escape(sender) + r"(?:\?)?\.(?:id|origin|url)"
|
|
143
|
+
op = r"(===|!==|==|!=)"
|
|
144
|
+
|
|
145
|
+
match1 = re.fullmatch(sender_prop + r"\s*" + op + r"\s*(['\"])([^'\"*\\$`]+)\2", condition)
|
|
146
|
+
match2 = re.fullmatch(r"(['\"])([^'\"*\\$`]+)\1\s*" + op + r"\s*" + sender_prop, condition)
|
|
147
|
+
|
|
148
|
+
if match1:
|
|
149
|
+
operator = match1[1]
|
|
150
|
+
elif match2:
|
|
151
|
+
operator = match2[3]
|
|
152
|
+
else:
|
|
153
|
+
operator = None
|
|
154
|
+
|
|
155
|
+
if operator:
|
|
156
|
+
is_equality = (operator in {"===", "=="})
|
|
157
|
+
if inverted:
|
|
158
|
+
is_equality = not is_equality
|
|
159
|
+
return 1 if is_equality else -1
|
|
160
|
+
|
|
161
|
+
match3 = re.fullmatch(r"(!)?\s*(\[[^\[\]]+\])\.includes\(\s*" + sender_prop + r"\s*\)", condition)
|
|
162
|
+
if match3:
|
|
163
|
+
includes_inverted = bool(match3[1])
|
|
164
|
+
if inverted:
|
|
165
|
+
includes_inverted = not includes_inverted
|
|
166
|
+
|
|
167
|
+
items = split_arguments(match3[2][1:-1])
|
|
65
168
|
if items and all(re.fullmatch(r"(['\"])[^'\"*\\$`]+\1", item) for item in items):
|
|
66
|
-
return -1 if
|
|
169
|
+
return -1 if includes_inverted else 1
|
|
170
|
+
|
|
67
171
|
return 0
|
|
68
172
|
|
|
69
173
|
return guarded_body(body, predicate)
|
|
@@ -20,7 +20,7 @@ from __future__ import annotations
|
|
|
20
20
|
import fnmatch
|
|
21
21
|
import json
|
|
22
22
|
import re
|
|
23
|
-
from datetime import date
|
|
23
|
+
from datetime import date, timedelta
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
|
|
26
26
|
from . import calibration
|
|
@@ -464,6 +464,90 @@ def load_acknowledgements(repo_root: Path, *, include_cwd: bool = False, context
|
|
|
464
464
|
return result
|
|
465
465
|
|
|
466
466
|
|
|
467
|
+
# ---- claimspec `ignore` writer (additive: the .websec-ignore format itself is unchanged) ----
|
|
468
|
+
# claimspec's `ignore` kind is "reviewable scoping": every entry carries a REASON, because the
|
|
469
|
+
# document exists for an auditor to read. `.websec-ignore` holds two suppression mechanisms and
|
|
470
|
+
# only one of them meets that bar:
|
|
471
|
+
# * `fingerprint:<id> expires:<date> # reason` — reason, expiry and lifecycle state all survive.
|
|
472
|
+
# * a bare gitignore-style pattern — `load_suppressions` discards the trailing `#`
|
|
473
|
+
# comment, so no reason survives anywhere in the process.
|
|
474
|
+
# The gap is NOT closed by inventing one. A synthesised "suppressed by .websec-ignore" would make
|
|
475
|
+
# an unreviewed suppression read to an auditor exactly like a reviewed one, which is the single
|
|
476
|
+
# thing this document exists to prevent. Those entries are omitted and COUNTED, and the count is
|
|
477
|
+
# returned to the caller so the export can never be mistaken for the whole policy.
|
|
478
|
+
CLAIMSPEC_IGNORE_SCHEMA_VERSION = 1
|
|
479
|
+
CLAIMSPEC_REASON_MIN = 8 # `reason` minLength in the claimspec ignore schema
|
|
480
|
+
CLAIMSPEC_REASON_MAX = 2000 # `reason` maxLength
|
|
481
|
+
CLAIMSPEC_PATTERN_MAX = 512 # `pattern` maxLength
|
|
482
|
+
_TRUNCATED = " …[truncated]"
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
def _claimspec_expiry(day: str) -> str:
|
|
486
|
+
"""``2026-12-31`` → ``2027-01-01T00:00:00Z``: the instant AFTER the last valid day.
|
|
487
|
+
|
|
488
|
+
websec stores a date and keeps the acknowledgement alive while ``expiry >= today``, i.e. through
|
|
489
|
+
the whole of that day. claimspec stores an instant after which the entry no longer applies.
|
|
490
|
+
Writing ``2026-12-31T00:00:00Z`` would retire the entry a full day before websec's own gate
|
|
491
|
+
does, so the two tools would disagree about the same finding on the same day.
|
|
492
|
+
"""
|
|
493
|
+
return (date.fromisoformat(day) + timedelta(days=1)).isoformat() + "T00:00:00Z"
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
def to_claimspec_ignore(repo_root: Path, *, include_cwd: bool = False, context=None,
|
|
497
|
+
today: date | None = None) -> tuple:
|
|
498
|
+
"""Render the reviewed acknowledgements in ``.websec-ignore`` as a claimspec v1 ``ignore``
|
|
499
|
+
document, plus a report of everything that could not be represented.
|
|
500
|
+
|
|
501
|
+
Returns ``(document, report)``. The schema sets ``additionalProperties: false`` and allows only
|
|
502
|
+
``$schema``/``schemaVersion``/``entries``, so the report cannot travel inside the document — and
|
|
503
|
+
that split is right: the artifact an auditor reads stays clean, while the operator is told
|
|
504
|
+
separately how much of their policy is missing from it.
|
|
505
|
+
|
|
506
|
+
Which acknowledgement states export, and why the rest do not:
|
|
507
|
+
active, expired exported WITH ``expires``. An expired entry is deliberately not dropped:
|
|
508
|
+
the schema has that field precisely so a consumer can warn about it, and
|
|
509
|
+
omitting it would hide a lapsed suppression from the auditor.
|
|
510
|
+
legacy-no-expiry exported without ``expires``; it genuinely has none.
|
|
511
|
+
missing-reason omitted — ``reason`` is required and there is nothing true to put in it.
|
|
512
|
+
malformed omitted — the expiry did not parse, so the entry's lifetime is unknown.
|
|
513
|
+
Exporting it without ``expires`` would silently promote a suppression the
|
|
514
|
+
operator meant to time-limit into one that never expires.
|
|
515
|
+
"""
|
|
516
|
+
today = today or date.today()
|
|
517
|
+
acks = load_acknowledgements(repo_root, include_cwd=include_cwd, context=context, today=today)
|
|
518
|
+
entries, omitted = [], []
|
|
519
|
+
for fingerprint, record in sorted(acks.records.items()):
|
|
520
|
+
state = record.get("state")
|
|
521
|
+
reason = (record.get("reason") or "").strip()
|
|
522
|
+
if state in ("missing-reason", "malformed") or len(reason) < CLAIMSPEC_REASON_MIN:
|
|
523
|
+
omitted.append({"fingerprint": fingerprint, "state": state,
|
|
524
|
+
"why": ("no reason to record" if len(reason) < CLAIMSPEC_REASON_MIN
|
|
525
|
+
else "expiry did not parse, so the entry's lifetime is unknown")})
|
|
526
|
+
continue
|
|
527
|
+
if len(fingerprint) > CLAIMSPEC_PATTERN_MAX:
|
|
528
|
+
omitted.append({"fingerprint": fingerprint[:64] + "…", "state": state,
|
|
529
|
+
"why": f"fingerprint exceeds the {CLAIMSPEC_PATTERN_MAX}-char pattern limit"})
|
|
530
|
+
continue
|
|
531
|
+
if len(reason) > CLAIMSPEC_REASON_MAX:
|
|
532
|
+
reason = reason[:CLAIMSPEC_REASON_MAX - len(_TRUNCATED)] + _TRUNCATED
|
|
533
|
+
entry = {"kind": "fingerprint", "pattern": fingerprint, "reason": reason}
|
|
534
|
+
if record.get("expires"):
|
|
535
|
+
entry["expires"] = _claimspec_expiry(record["expires"])
|
|
536
|
+
entries.append(entry)
|
|
537
|
+
|
|
538
|
+
patterns = load_suppressions(repo_root, include_cwd=include_cwd, context=context)
|
|
539
|
+
report = {
|
|
540
|
+
"entries": len(entries),
|
|
541
|
+
"omitted_acknowledgements": omitted,
|
|
542
|
+
"omitted_patterns": len(patterns),
|
|
543
|
+
# False means the exported document is NOT the project's whole suppression policy. A caller
|
|
544
|
+
# that renders this must say so; an auditor reading a partial policy as a complete one is
|
|
545
|
+
# exactly the misreading the reason field exists to stop.
|
|
546
|
+
"complete": not omitted and not patterns,
|
|
547
|
+
}
|
|
548
|
+
return {"schemaVersion": CLAIMSPEC_IGNORE_SCHEMA_VERSION, "entries": entries}, report
|
|
549
|
+
|
|
550
|
+
|
|
467
551
|
def _suppressed(f, pats):
|
|
468
552
|
hay = f"{f.get('category','')} {f.get('location','')} {f.get('title','')}".lower()
|
|
469
553
|
for p in pats:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: websec-validator
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.0
|
|
4
4
|
Summary: Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app.
|
|
5
5
|
Author: Ricardo Accioly
|
|
6
6
|
License: MIT
|
|
@@ -49,6 +49,12 @@ A senior pentester's "here's what to test and how" handoff — auto-generated fr
|
|
|
49
49
|
|
|
50
50
|
[](assets/demo.gif)
|
|
51
51
|
|
|
52
|
+
**New here?** Read the eight-page technical brief — what it reads, how a finding earns its severity,
|
|
53
|
+
what it refuses to say, and the field evidence:
|
|
54
|
+
**[raccioly.github.io/websec-validator](https://raccioly.github.io/websec-validator/websec-explained.html)**
|
|
55
|
+
· [PDF](https://raccioly.github.io/websec-validator/websec-explained.pdf). Every number in it is
|
|
56
|
+
asserted against this tree by `tests/test_explained_brief.py`, so it cannot drift silently.
|
|
57
|
+
|
|
52
58
|
It is *not* an autonomous scanner and *not* a SaaS. It's the missing front-half: the thing that
|
|
53
59
|
turns a repo into a precise, fact-grounded security brief an AI agent (with a human in the loop)
|
|
54
60
|
can act on — an auto-filled, repo-aware version of a senior pentester's "here's what to test and
|
|
@@ -128,12 +134,15 @@ No need to install Noir or the scanners separately — the image carries a worki
|
|
|
128
134
|
```bash
|
|
129
135
|
docker build -t websec-validator .
|
|
130
136
|
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out
|
|
137
|
+
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out --scan # …and execute the bundled scanners
|
|
131
138
|
```
|
|
132
139
|
|
|
133
140
|
The image carries Noir + Trivy + Gitleaks + Semgrep + Checkov — not the full list above, so
|
|
134
141
|
OSV-Scanner, Prowler and the per-language SAST tools (Bandit, gosec, Brakeman) are absent and are
|
|
135
|
-
reported as missing rather than silently skipped.
|
|
136
|
-
|
|
142
|
+
reported as missing rather than silently skipped. **Bundling them is not the same as running them:**
|
|
143
|
+
Noir is the route engine and runs on every `run`, but the four static scanners execute only under
|
|
144
|
+
`--scan` — a plain `run` lists them and prints `(add --scan to execute them)`, exactly as it does
|
|
145
|
+
outside Docker. Mount your repo at `/scan`; artifacts land in `/scan/websec-out`.
|
|
137
146
|
|
|
138
147
|
## Usage
|
|
139
148
|
|
|
@@ -697,8 +706,9 @@ add the matching dated changelog and migration guidance, and validate the combin
|
|
|
697
706
|
In the 0.x series, feature additions or incompatible contracts increment the minor version.
|
|
698
707
|
|
|
699
708
|
After reviewing current main and overlapping PRs, merge the approved release PR only after its
|
|
700
|
-
required CI checks pass. The resulting main commit subject must be `release:
|
|
701
|
-
|
|
709
|
+
required CI checks pass. The resulting main commit subject must be `release: v<version>`, where
|
|
710
|
+
`<version>` is whatever `pyproject.toml` currently declares — do not hard-code a number here, it
|
|
711
|
+
drifts. [release-tag.yml](.github/workflows/release-tag.yml) validates that subject against the
|
|
702
712
|
package version, creates the matching tag/GitHub Release, and explicitly dispatches
|
|
703
713
|
[publish.yml](.github/workflows/publish.yml) at that tag. A version edit alone does not publish.
|
|
704
714
|
|
|
@@ -713,7 +723,7 @@ omit an independent version field. Check both sources when diagnosing stale inst
|
|
|
713
723
|
|
|
714
724
|
## Status / roadmap
|
|
715
725
|
|
|
716
|
-
Version 0.
|
|
726
|
+
Version 0.18.0 provides 22 recon extractors, eleven optional scanner entries, nine named profiles,
|
|
717
727
|
SARIF import/export, bounded source/query analysis, explicit coverage and lifecycle evidence,
|
|
718
728
|
intelligence/research commands, and opt-in agent/hook/CI adoption. It adds an in-loop security gate
|
|
719
729
|
(`websec gate` and a `PostToolUse` hook), analysis scoping with `--only`, an opt-in dependency
|
|
@@ -725,7 +735,12 @@ in-loop gate is developer ergonomics, not a control, and `attest` reports eviden
|
|
|
725
735
|
rendering a compliance verdict.
|
|
726
736
|
|
|
727
737
|
The [0.14.0 migration guide](docs/MIGRATING-0.14.0.md) explains schema 2.0 and gate/artifact
|
|
728
|
-
changes. 0.16.0
|
|
738
|
+
changes. 0.16.0 added the claimspec calibration export over 0.15.3 and needed no migration.
|
|
739
|
+
0.17.0 split the exit codes (`2` = usage error, `3` = incomplete run) — the one breaking change in the
|
|
740
|
+
project's history; CI scripts that tested for `2` as "incomplete" must test for `3`. 0.17.1 changed no
|
|
741
|
+
behaviour: it corrected only what the tool says about itself.
|
|
742
|
+
0.18.0 adds a measured `P(real)` from a relabelled corpus, and stops a scan that could read no
|
|
743
|
+
analyzable source from reporting as a completed clean run (`--require-analyzed`, exit 3).
|
|
729
744
|
The [remaining-work specification](specs/001-continuous-security-improvement/spec.md) consolidates
|
|
730
745
|
unresolved gaps and acceptance tests so overlapping old-base PRs do not become competing roadmaps.
|
|
731
746
|
Existing runtime probes are opt-in; their earlier isolated results are not current deployment proofs.
|