GrantTrace
English | 简体中文
Evidence-driven, read-only authorization testing for OpenAPI APIs.
GrantTrace reads your OpenAPI specification, requests the same resources as an Owner, a Visitor and an Anonymous identity, and compares what each of them gets back. It reports BOLA / IDOR and related authorization flaws only when the responses prove them, plans every request offline first, and never writes to your API.
python -m pip install granttrace
granttrace demo # a disposable local API; no configuration or credentials needed
The demo starts a throwaway API on 127.0.0.1, finds the BOLA and the mass
assignment flaw it contains, restores its data, stops, and writes an HTML and a
JSON report. A sample report
is in the repository.
Why GrantTrace
- Evidence, not status codes. A BOLA finding is
CONFIRMEDonly when the Owner's own request returns a valid response, the Anonymous request is explicitly denied, and the Visitor's response contains concrete values or identifiers from the Owner's resource. Weaker signals are reported asSUSPICIOUSorINCONCLUSIVE, never as vulnerabilities. - Safe by default. Scans are read-only. GET operations whose paths, identifiers or descriptions suggest side effects are skipped before any request, and writes against external targets are refused.
- Plan before you send.
--init-configdrafts a configuration and a review checklist from the specification,--validate-configchecks it offline, and--dry-runshows what would be requested while sending nothing. - Reports people can act on. Each result explains what was compared; each
confirmed finding comes with remediation, retest steps, a cURL template and
minimized evidence. Credentials are redacted unless you opt in with
--include-sensitive-evidence. JSON serves automation and SARIF serves code scanning. - Honest coverage. Reports show attempted and conclusive coverage separately. No confirmed findings does not mean an API is secure.
What it checks
| Check | CWE | How it runs | What you configure |
|---|---|---|---|
| BOLA / IDOR | CWE-639 | Read-only, as Owner, Visitor and Anonymous | Two test accounts and a resource each of them owns |
| Broken Authentication | CWE-306 | Read-only, on operations the specification protects | private_data_paths: Owner values Anonymous must not see |
| Broken Function Level Authorization | CWE-285 | Read-only | The required role and each identity's role |
| Private data in collections | CWE-639 | Read-only, on list endpoints | private_data_paths |
| Property-level authorization (BOPLA) | CWE-200 | Read-only | Per-field rules in bopla |
| Mass Assignment | CWE-915 | Built-in demo only | – |
Mass assignment testing writes to a resource, so GrantTrace only does it when it can verify the resource's actual state and restore it. It cannot observe that state for an external API, so PATCH and PUT checks against your target stop before any write; the built-in demo, which owns its data, shows the complete flow with independent readback and verified rollback.
Not supported yet: GraphQL and gRPC; OAuth, OIDC or mTLS login flows (configure tokens or headers yourself); API keys in the query string; POST and DELETE tests; writes against external APIs.
Install
- Python 3.9+ on macOS, Linux or Windows:
python -m pip install granttrace - Windows without Python: download
GrantTrace-v<version>-Windows-x64.zipfrom the latest release, unzip the whole archive and double-clickStart-Demo.bat. The program is not code-signed yet, so SmartScreen may warn about it; check the download against the release'sSHA256SUMS.txt. See Windows portable.
This README describes the main branch; the
changelog lists
what each release contains.
Audit your own API
Use a test environment you are authorized to test, two test accounts, and resources each of them owns. Steps 1 to 4 only touch local files.
# 1. Draft a configuration and a review checklist from the specification
granttrace --spec openapi.yaml --init-config config.local.json
# 2. Edit config.local.json: test accounts, their resources and expected access;
# replace every __GRANTTRACE_INPUT__: placeholder, then remove _granttrace_draft
# 3. Validate offline
granttrace --spec openapi.yaml --config config.local.json --validate-config
# 4. Review the plan; a dry run sends no requests
granttrace --spec openapi.yaml --config config.local.json --dry-run --export-json plan.local.json
# 5. Run a read-only scan against an authorized test target
granttrace --spec openapi.yaml --config config.local.json \
--target https://authorized-test.example --export-json result.local.json
A specification cannot say who owns a resource or who may read it: that comes from you. Shared resources and administrator access can be legitimate; declare them in the configuration rather than treating them as findings. The configuration guide covers identities, API keys and cookies, policies and the evidence each check needs.
Outputs
- HTML (
-o report.html;granttrace_report.htmlby default): summary, coverage, one row per check and one card per confirmed finding. - JSON (
--export-json): every result with its evidence, for automation. - SARIF 2.1.0 (
--export-sarif): confirmed findings only, for GitHub code scanning. See SARIF export.
The HTML report's interface text is in Chinese for now; check reasons and evidence are in English.
Safety
Only test systems you are explicitly authorized to test. GrantTrace stays read-only against your API and refuses writes to external targets, but static rules cannot prove that every GET is harmless, so review the dry-run plan before a scan. Report vulnerabilities in GrantTrace itself privately, as described in SECURITY.md.
Documentation
- Configuration guide (Chinese)
- Command line, outputs and SARIF (Chinese)
- Parameter serialization (Chinese)
- Property-level checks (BOPLA) (Chinese)
- Remote
$refresolution - Authorization evidence hardening (v2.5.2 audit record)
- Business scenario acceptance (Chinese)
- Case study: VAmPI: what a scan of a deliberately vulnerable API found and missed
- Case study: crAPI: the same for OWASP's microservice API
- How GrantTrace compares with Autorize, AuthMatrix, ZAP and Akto
- Verification records
Development
git clone https://github.com/ysc070528/granttrace.git
cd granttrace
python -m pip install -e ".[dev]" "setuptools>=77" wheel
python -m pytest
To scan the bundled mock target, run python mock_server/server.py and, in a
second terminal, granttrace --spec openapi.json --config config.example.json --target http://127.0.0.1:8080. CONTRIBUTING.md
lists the checks CI runs. Contributors follow the
Code of Conduct.
License
Metadata
Release files for granttrace 2.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| granttrace-2.6.0.tar.gz | 1.5 MB | With provenance | Details for granttrace-2.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| granttrace-2.6.0-py3-none-any.whl | Python 3 | none | any | Details for granttrace-2.6.0-py3-none-any.whl |
Total release size: 1.7 MB
Release files / granttrace-2.6.0.tar.gz
| Download URL | granttrace-2.6.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8447c35c894f56d4324dba6a3086e416333ca76befc23de75caf87a7ccb9865
|
|
BLAKE2b-256 checksum How to use checksums |
43d1bc7426074491bd119d17a190bbf53ccf6434b36b4b15a083fc77899dcafa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / granttrace-2.6.0-py3-none-any.whl
| Download URL | granttrace-2.6.0-py3-none-any.whl |
|---|---|
| Size | 185.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8573231bb9f0b245213569debdd7ba9830b26e3f620f6bcc811bcea70b0b2f90
|
|
BLAKE2b-256 checksum How to use checksums |
afde15630e3ecb58681a0addec93069d6af68e85f4c6e0a2defc0ef6d9e7e7e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for granttrace 2.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for granttrace-2.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.