docs(taint): document per-language model files (#2809)

* docs(taint): document per-language model files

* docs(taint): link language-specific model tests

---------

Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
This commit is contained in:
Parafee41 2026-08-05 16:15:32 +08:00 committed by GitHub
parent a6a8aa788c
commit a857f4c5a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 21 deletions

View file

@ -148,13 +148,19 @@ finding is NOT proof of safety.
## Adding a source / sink / sanitizer ## Adding a source / sink / sanitizer
Edit the language model in `taint/typescript-model.ts` (registered via the Taint models cover four `SupportedLanguages` ids across three files:
explicit `registerBuiltinTaintModels` seam, keyed by `SupportedLanguages`). The TypeScript and JavaScript use `taint/typescript-model.ts`, Python uses
spec is hashable data (no functions). A sanitizer's `neutralizes` lists the `taint/python-model.ts`, and Java uses `taint/java-model.ts`. Edit the model
EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert the for the language you are targeting. The explicit
finding (or its absence) in `test/unit/taint/` (real-source harness: `registerBuiltinTaintModels` seam in `typescript-model.ts` registers all four;
`test/helpers/ts-cfg-harness.ts`); the end-to-end proof is it is not an import side effect.
`test/integration/cfg/`.
The spec is hashable data (no functions). A sanitizer's `neutralizes` lists
the EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert
the finding (or its absence) in `test/unit/taint/`. TypeScript and JavaScript
use the real-source harness `test/helpers/ts-cfg-harness.ts`; Python and Java
model matches are covered by `python-model-match.test.ts` and
`java-model-match.test.ts`. The end-to-end proof is `test/integration/cfg/`.
## Validation checklist for any `--pdg` change ## Validation checklist for any `--pdg` change

View file

@ -148,13 +148,19 @@ finding is NOT proof of safety.
## Adding a source / sink / sanitizer ## Adding a source / sink / sanitizer
Edit the language model in `taint/typescript-model.ts` (registered via the Taint models cover four `SupportedLanguages` ids across three files:
explicit `registerBuiltinTaintModels` seam, keyed by `SupportedLanguages`). The TypeScript and JavaScript use `taint/typescript-model.ts`, Python uses
spec is hashable data (no functions). A sanitizer's `neutralizes` lists the `taint/python-model.ts`, and Java uses `taint/java-model.ts`. Edit the model
EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert the for the language you are targeting. The explicit
finding (or its absence) in `test/unit/taint/` (real-source harness: `registerBuiltinTaintModels` seam in `typescript-model.ts` registers all four;
`test/helpers/ts-cfg-harness.ts`); the end-to-end proof is it is not an import side effect.
`test/integration/cfg/`.
The spec is hashable data (no functions). A sanitizer's `neutralizes` lists
the EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert
the finding (or its absence) in `test/unit/taint/`. TypeScript and JavaScript
use the real-source harness `test/helpers/ts-cfg-harness.ts`; Python and Java
model matches are covered by `python-model-match.test.ts` and
`java-model-match.test.ts`. The end-to-end proof is `test/integration/cfg/`.
## Validation checklist for any `--pdg` change ## Validation checklist for any `--pdg` change

View file

@ -148,13 +148,19 @@ finding is NOT proof of safety.
## Adding a source / sink / sanitizer ## Adding a source / sink / sanitizer
Edit the language model in `taint/typescript-model.ts` (registered via the Taint models cover four `SupportedLanguages` ids across three files:
explicit `registerBuiltinTaintModels` seam, keyed by `SupportedLanguages`). The TypeScript and JavaScript use `taint/typescript-model.ts`, Python uses
spec is hashable data (no functions). A sanitizer's `neutralizes` lists the `taint/python-model.ts`, and Java uses `taint/java-model.ts`. Edit the model
EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert the for the language you are targeting. The explicit
finding (or its absence) in `test/unit/taint/` (real-source harness: `registerBuiltinTaintModels` seam in `typescript-model.ts` registers all four;
`test/helpers/ts-cfg-harness.ts`); the end-to-end proof is it is not an import side effect.
`test/integration/cfg/`.
The spec is hashable data (no functions). A sanitizer's `neutralizes` lists
the EXACT sink kinds it defends — never a blanket kill. Add a fixture + assert
the finding (or its absence) in `test/unit/taint/`. TypeScript and JavaScript
use the real-source harness `test/helpers/ts-cfg-harness.ts`; Python and Java
model matches are covered by `python-model-match.test.ts` and
`java-model-match.test.ts`. The end-to-end proof is `test/integration/cfg/`.
## Validation checklist for any `--pdg` change ## Validation checklist for any `--pdg` change