blint 3.2.4__tar.gz → 3.3.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.
Files changed (87) hide show
  1. {blint-3.2.4 → blint-3.3.0}/PKG-INFO +35 -15
  2. {blint-3.2.4 → blint-3.3.0}/README.md +32 -12
  3. {blint-3.2.4 → blint-3.3.0}/blint/cli.py +43 -13
  4. {blint-3.2.4 → blint-3.3.0}/blint/config.py +70 -48
  5. blint-3.3.0/blint/data/annotations/review_drivers_win.yml +77 -0
  6. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_functions_generic.yml +12 -0
  7. blint-3.3.0/blint/data/annotations/review_implants_pe.yml +183 -0
  8. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_imports_pe.yml +54 -0
  9. {blint-3.2.4 → blint-3.3.0}/blint/data/rules.yml +91 -0
  10. {blint-3.2.4 → blint-3.3.0}/blint/lib/analysis.py +148 -37
  11. {blint-3.2.4 → blint-3.3.0}/blint/lib/android.py +73 -40
  12. {blint-3.2.4 → blint-3.3.0}/blint/lib/binary.py +867 -207
  13. blint-3.3.0/blint/lib/binary_reviews.py +368 -0
  14. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/canon.py +24 -12
  15. blint-3.3.0/blint/lib/checks.py +178 -0
  16. blint-3.3.0/blint/lib/crypto_constants.py +340 -0
  17. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik_review.py +3 -6
  18. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik_semantics.py +3 -3
  19. {blint-3.2.4 → blint-3.3.0}/blint/lib/disassembler.py +87 -53
  20. blint-3.3.0/blint/lib/driver_ioctl.py +750 -0
  21. blint-3.3.0/blint/lib/elf_abi.py +477 -0
  22. blint-3.3.0/blint/lib/elf_dlopen.py +318 -0
  23. blint-3.3.0/blint/lib/elf_linkmap.py +393 -0
  24. {blint-3.2.4 → blint-3.3.0}/blint/lib/function_reviews.py +71 -24
  25. blint-3.3.0/blint/lib/implant_reviews.py +896 -0
  26. blint-3.3.0/blint/lib/import_attribution.py +291 -0
  27. {blint-3.2.4 → blint-3.3.0}/blint/lib/indicators.py +8 -8
  28. {blint-3.2.4 → blint-3.3.0}/blint/lib/macho_objc.py +28 -23
  29. {blint-3.2.4 → blint-3.3.0}/blint/lib/review_runner.py +46 -22
  30. {blint-3.2.4 → blint-3.3.0}/blint/lib/review_utils.py +23 -16
  31. {blint-3.2.4 → blint-3.3.0}/blint/lib/runners.py +72 -21
  32. {blint-3.2.4 → blint-3.3.0}/blint/lib/sbom.py +407 -45
  33. blint-3.3.0/blint/lib/stack_strings.py +452 -0
  34. {blint-3.2.4 → blint-3.3.0}/blint/lib/utils.py +153 -84
  35. {blint-3.2.4 → blint-3.3.0}/blint/logger.py +4 -4
  36. {blint-3.2.4 → blint-3.3.0}/pyproject.toml +3 -3
  37. blint-3.2.4/blint/lib/checks.py +0 -89
  38. {blint-3.2.4 → blint-3.3.0}/LICENSE +0 -0
  39. {blint-3.2.4 → blint-3.3.0}/blint/__init__.py +0 -0
  40. {blint-3.2.4 → blint-3.3.0}/blint/cyclonedx/README.md +0 -0
  41. {blint-3.2.4 → blint-3.3.0}/blint/cyclonedx/__init__.py +0 -0
  42. {blint-3.2.4 → blint-3.3.0}/blint/cyclonedx/spdx.py +0 -0
  43. {blint-3.2.4 → blint-3.3.0}/blint/cyclonedx/spec.py +0 -0
  44. {blint-3.2.4 → blint-3.3.0}/blint/data/__init__.py +0 -0
  45. {blint-3.2.4 → blint-3.3.0}/blint/data/android-services.json +0 -0
  46. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/__init__.py +0 -0
  47. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_apple_local_privesc_mie.yml +0 -0
  48. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_entries_generic.yml +0 -0
  49. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_entries_pe.yml +0 -0
  50. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_exe_go.yml +0 -0
  51. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_ios_fingerprint.yml +0 -0
  52. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_ios_masvs.yml +0 -0
  53. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_ios_privacy_access.yml +0 -0
  54. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_ios_privacy_posture.yml +0 -0
  55. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_ios_sidechannel.yml +0 -0
  56. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_methods_android.yml +0 -0
  57. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_methods_generic.yml +0 -0
  58. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_methods_mips.yml +0 -0
  59. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_methods_pe.yml +0 -0
  60. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_monero_generic.yml +0 -0
  61. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_monero_go.yml +0 -0
  62. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_monero_rust.yml +0 -0
  63. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_rootkits_win.yml +0 -0
  64. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_rpc_win.yml +0 -0
  65. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_symbols_antiforensic.yml +0 -0
  66. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_symbols_generic.yml +0 -0
  67. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_symbols_hooka.yml +0 -0
  68. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_symbols_macho.yml +0 -0
  69. {blint-3.2.4 → blint-3.3.0}/blint/data/annotations/review_symbols_rust.yml +0 -0
  70. {blint-3.2.4 → blint-3.3.0}/blint/data/trackers.json +0 -0
  71. {blint-3.2.4 → blint-3.3.0}/blint/db.py +0 -0
  72. {blint-3.2.4 → blint-3.3.0}/blint/lib/__init__.py +0 -0
  73. {blint-3.2.4 → blint-3.3.0}/blint/lib/android_services.py +0 -0
  74. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/__init__.py +0 -0
  75. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/algorithms.py +0 -0
  76. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/api.py +0 -0
  77. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/command.py +0 -0
  78. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/fingerprint.py +0 -0
  79. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/match.py +0 -0
  80. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/model.py +0 -0
  81. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph/rusi.py +0 -0
  82. {blint-3.2.4 → blint-3.3.0}/blint/lib/callgraph_kpi.py +0 -0
  83. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik.py +0 -0
  84. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik_callgraph.py +0 -0
  85. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik_cfg.py +0 -0
  86. {blint-3.2.4 → blint-3.3.0}/blint/lib/dalvik_dataflow.py +0 -0
  87. {blint-3.2.4 → blint-3.3.0}/blint/lib/ios.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blint
3
- Version: 3.2.4
3
+ Version: 3.3.0
4
4
  Summary: Linter and SBOM generator for binary files.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -29,7 +29,7 @@ Requires-Dist: custom-json-diff (>=2.1.6)
29
29
  Requires-Dist: defusedxml (>=0.7.1)
30
30
  Requires-Dist: flake8 (>=7.3.0) ; extra == "dev"
31
31
  Requires-Dist: lief (>=0.17.4)
32
- Requires-Dist: multi-demangle (>=1.0.3)
32
+ Requires-Dist: multi-demangle (>=2.0.1)
33
33
  Requires-Dist: oras (>=0.2.41)
34
34
  Requires-Dist: orjson (>=3.11.7)
35
35
  Requires-Dist: packageurl-python (>=0.17.6)
@@ -40,7 +40,7 @@ Requires-Dist: pytest (>=9.0.3) ; extra == "dev"
40
40
  Requires-Dist: pytest-cov (>=7.1.0) ; extra == "dev"
41
41
  Requires-Dist: rich (>=15.0.0)
42
42
  Requires-Dist: ruff (>=0.14.0) ; extra == "dev"
43
- Requires-Dist: wasm-tools (>=1.0.3)
43
+ Requires-Dist: wasm-tools (>=2.0.0)
44
44
  Project-URL: CI, https://github.com/owasp-dep-scan/blint/actions
45
45
  Description-Content-Type: text/markdown
46
46
 
@@ -152,17 +152,17 @@ blint sbom -i /path/to/app.apkm -o sbom.cdx.json --deep --disassembly
152
152
 
153
153
  blint produces several JSON artifacts in the specified reports directory.
154
154
 
155
- | Filename | Purpose | Details |
156
- | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
157
- | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
158
- | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail. |
159
- | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. |
160
- | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
161
- | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
162
- | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
163
- | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
164
- | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
165
- | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
155
+ | Filename | Purpose | Details |
156
+ | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
157
+ | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
158
+ | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail, extracted strings with secret/IoC screening, the labeled call graph, toolchain fingerprint, and the `component` interface inventory for Component Model binaries. |
159
+ | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. For WASM inputs, the `wasm_tools` analysis findings (`WASM-*`) are passed through as findings. |
160
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
161
+ | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
162
+ | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
163
+ | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
164
+ | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
165
+ | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
166
166
 
167
167
  ## Advanced Usage: SBOM Generation with blintdb
168
168
 
@@ -202,12 +202,28 @@ For repeatable end-to-end validation of local `blint-db` changes, use the integr
202
202
 
203
203
  The generated `summary.json` includes per-ecosystem provenance copied from the linked `blint-db` run metadata under `ecosystems.<name>.provenance`. That block mirrors `projects.selected_count`, `attempted_count`, `success_count`, `failure_count`, `status_counts`, and `build_failures`. Each `projects.build_failures[]` entry is a flattened per-project failure record with stable keys such as `selector`, `project_name`, `ecosystem`, `build_system`, `status`, `stage`, and `message`, plus optional details like `returncode` or `exception_type` when they are available.
204
204
 
205
+ ## WebAssembly Component Model SBOM
206
+
207
+ `blint sbom` skips `.wasm` inputs by default. Pass `--wasm-sbom` to include Component Model binaries: their imported WIT interface packages (for example `wasi:cli` at `0.2.0`) are emitted as required library components, and the wasm binary itself becomes the application parent.
208
+
209
+ The purls are built from exact import evidence only (`pkg:generic/wasi/cli@0.2.0?type=wasm` maps the WIT namespace/package identity; the `type=wasm` qualifier follows the format proposed in the wasm-tools dependency research notes). Exported interfaces are recorded as a property on the parent rather than as dependencies, because they are capabilities the binary provides. Core modules are skipped: their imports carry no package identity, so no versionless or fuzzy guesses are emitted.
210
+
211
+ ```shell
212
+ blint sbom -i /path/to/component.wasm -o sbom.cdx.json --wasm-sbom
213
+ ```
214
+
205
215
  ## Environment Variables
206
216
 
207
217
  - `BLINTDB_HOME`, `BLINTDB_IMAGE_URL`, `BLINTDB_REFRESH`: Control blintdb download location, source image, and refresh behavior.
208
218
  - `BLINT_MAX_HEX_BYTES`: Maximum number of raw bytes converted to hex when metadata contains undecodable byte sequences. Default is `4096`.
209
219
  - `0` disables truncation.
210
220
  - When truncation happens, blint appends `...<truncated:N_bytes>` to preserve context without producing huge JSON fields.
221
+ - `BLINT_MAX_WASM_INSTRUCTIONS`: Total instruction-stream budget for each `*-wasm-report.json`. Instruction streams are the only unbounded part of the wasm parser output and dominate the report size for large modules. Default is `50000`; `0` disables the cap.
222
+ - The budget is divided max-min fair across every function in the report, so short functions keep their whole body and the remainder goes to the long ones, rather than the first functions in section order consuming everything.
223
+ - Trimmed functions keep their truthful `instruction_count` and gain an `instructions_truncated` count, and the report gains a top-level `blint_truncation` block recording the budget, the instructions dropped, and how many functions were affected.
224
+ - `BLINT_RESOLVE_LINK_CLOSURE`: Set to `1` to resolve each ELF binary's dynamic dependency closure the way the loader would, reporting libraries that cannot be found, imported symbols nothing in the closure defines, and search paths that let an untrusted directory answer first. Off by default, because resolution reads the filesystem the scan runs on and is only meaningful when that filesystem is the binary's intended runtime. Results land in the `link_closure` metadata block.
225
+ - `BLINT_LINK_ROOT`: Filesystem root to resolve against. Point this at an unpacked container image or sysroot rather than at the scanning host. Default is `/`.
226
+ - `BLINT_LINK_SEARCH_PATH`: Extra directories treated as if they were in `LD_LIBRARY_PATH`, separated by the platform path separator.
211
227
 
212
228
  ## Command-Line Reference
213
229
 
@@ -215,7 +231,7 @@ The generated `summary.json` includes per-ecosystem provenance copied from the l
215
231
  <summary><strong>Main Command Help</strong></summary>
216
232
 
217
233
  ```shell
218
- usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
234
+ usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--no-wasm-strings] [--no-wasm-call-graph] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
219
235
 
220
236
  Binary linter and SBOM generator.
221
237
 
@@ -228,6 +244,8 @@ options:
228
244
  --no-error Continue on error to prevent build from breaking.
229
245
  --no-banner Do not display banner.
230
246
  --no-reviews Do not perform method reviews.
247
+ --no-wasm-strings Do not extract strings from wasm files. Shrinks the wasm report and disables the string-based wasm findings (e.g. WASM-STR-007).
248
+ --no-wasm-call-graph Do not build the wasm_tools call graph for wasm files. Shrinks the wasm report and disables wasm callgraph exports.
231
249
  --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
232
250
  --use-blintdb Use blintdb v2 for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
233
251
  --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
@@ -259,6 +277,7 @@ sub-commands:
259
277
  ```shell
260
278
  usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [-q]
261
279
  [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]] [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]] [--use-blintdb]
280
+ [--wasm-sbom]
262
281
 
263
282
  options:
264
283
  -h, --help show this help message and exit
@@ -274,6 +293,7 @@ options:
274
293
  --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
275
294
  Directories containing pre-build and build BOMs. Use to improve the precision.
276
295
  --use-blintdb Use blintdb v2 for symbol and disassembly-hash resolution. Defaults to true if the local database file exists.
296
+ --wasm-sbom Emit SBOM components from WebAssembly Component Model binaries using their imported WIT interface packages (e.g. wasi:cli@0.2.0) as exact evidence. Core modules without component-model evidence are skipped.
277
297
  ```
278
298
 
279
299
  </details>
@@ -106,17 +106,17 @@ blint sbom -i /path/to/app.apkm -o sbom.cdx.json --deep --disassembly
106
106
 
107
107
  blint produces several JSON artifacts in the specified reports directory.
108
108
 
109
- | Filename | Purpose | Details |
110
- | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111
- | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
112
- | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail. |
113
- | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. |
114
- | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
115
- | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
116
- | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
117
- | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
118
- | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
119
- | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
109
+ | Filename | Purpose | Details |
110
+ | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111
+ | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
112
+ | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail, extracted strings with secret/IoC screening, the labeled call graph, toolchain fingerprint, and the `component` interface inventory for Component Model binaries. |
113
+ | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. For WASM inputs, the `wasm_tools` analysis findings (`WASM-*`) are passed through as findings. |
114
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
115
+ | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
116
+ | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
117
+ | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
118
+ | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
119
+ | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
120
120
 
121
121
  ## Advanced Usage: SBOM Generation with blintdb
122
122
 
@@ -156,12 +156,28 @@ For repeatable end-to-end validation of local `blint-db` changes, use the integr
156
156
 
157
157
  The generated `summary.json` includes per-ecosystem provenance copied from the linked `blint-db` run metadata under `ecosystems.<name>.provenance`. That block mirrors `projects.selected_count`, `attempted_count`, `success_count`, `failure_count`, `status_counts`, and `build_failures`. Each `projects.build_failures[]` entry is a flattened per-project failure record with stable keys such as `selector`, `project_name`, `ecosystem`, `build_system`, `status`, `stage`, and `message`, plus optional details like `returncode` or `exception_type` when they are available.
158
158
 
159
+ ## WebAssembly Component Model SBOM
160
+
161
+ `blint sbom` skips `.wasm` inputs by default. Pass `--wasm-sbom` to include Component Model binaries: their imported WIT interface packages (for example `wasi:cli` at `0.2.0`) are emitted as required library components, and the wasm binary itself becomes the application parent.
162
+
163
+ The purls are built from exact import evidence only (`pkg:generic/wasi/cli@0.2.0?type=wasm` maps the WIT namespace/package identity; the `type=wasm` qualifier follows the format proposed in the wasm-tools dependency research notes). Exported interfaces are recorded as a property on the parent rather than as dependencies, because they are capabilities the binary provides. Core modules are skipped: their imports carry no package identity, so no versionless or fuzzy guesses are emitted.
164
+
165
+ ```shell
166
+ blint sbom -i /path/to/component.wasm -o sbom.cdx.json --wasm-sbom
167
+ ```
168
+
159
169
  ## Environment Variables
160
170
 
161
171
  - `BLINTDB_HOME`, `BLINTDB_IMAGE_URL`, `BLINTDB_REFRESH`: Control blintdb download location, source image, and refresh behavior.
162
172
  - `BLINT_MAX_HEX_BYTES`: Maximum number of raw bytes converted to hex when metadata contains undecodable byte sequences. Default is `4096`.
163
173
  - `0` disables truncation.
164
174
  - When truncation happens, blint appends `...<truncated:N_bytes>` to preserve context without producing huge JSON fields.
175
+ - `BLINT_MAX_WASM_INSTRUCTIONS`: Total instruction-stream budget for each `*-wasm-report.json`. Instruction streams are the only unbounded part of the wasm parser output and dominate the report size for large modules. Default is `50000`; `0` disables the cap.
176
+ - The budget is divided max-min fair across every function in the report, so short functions keep their whole body and the remainder goes to the long ones, rather than the first functions in section order consuming everything.
177
+ - Trimmed functions keep their truthful `instruction_count` and gain an `instructions_truncated` count, and the report gains a top-level `blint_truncation` block recording the budget, the instructions dropped, and how many functions were affected.
178
+ - `BLINT_RESOLVE_LINK_CLOSURE`: Set to `1` to resolve each ELF binary's dynamic dependency closure the way the loader would, reporting libraries that cannot be found, imported symbols nothing in the closure defines, and search paths that let an untrusted directory answer first. Off by default, because resolution reads the filesystem the scan runs on and is only meaningful when that filesystem is the binary's intended runtime. Results land in the `link_closure` metadata block.
179
+ - `BLINT_LINK_ROOT`: Filesystem root to resolve against. Point this at an unpacked container image or sysroot rather than at the scanning host. Default is `/`.
180
+ - `BLINT_LINK_SEARCH_PATH`: Extra directories treated as if they were in `LD_LIBRARY_PATH`, separated by the platform path separator.
165
181
 
166
182
  ## Command-Line Reference
167
183
 
@@ -169,7 +185,7 @@ The generated `summary.json` includes per-ecosystem provenance copied from the l
169
185
  <summary><strong>Main Command Help</strong></summary>
170
186
 
171
187
  ```shell
172
- usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
188
+ usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--no-wasm-strings] [--no-wasm-call-graph] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
173
189
 
174
190
  Binary linter and SBOM generator.
175
191
 
@@ -182,6 +198,8 @@ options:
182
198
  --no-error Continue on error to prevent build from breaking.
183
199
  --no-banner Do not display banner.
184
200
  --no-reviews Do not perform method reviews.
201
+ --no-wasm-strings Do not extract strings from wasm files. Shrinks the wasm report and disables the string-based wasm findings (e.g. WASM-STR-007).
202
+ --no-wasm-call-graph Do not build the wasm_tools call graph for wasm files. Shrinks the wasm report and disables wasm callgraph exports.
185
203
  --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
186
204
  --use-blintdb Use blintdb v2 for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
187
205
  --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
@@ -213,6 +231,7 @@ sub-commands:
213
231
  ```shell
214
232
  usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [-q]
215
233
  [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]] [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]] [--use-blintdb]
234
+ [--wasm-sbom]
216
235
 
217
236
  options:
218
237
  -h, --help show this help message and exit
@@ -228,6 +247,7 @@ options:
228
247
  --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
229
248
  Directories containing pre-build and build BOMs. Use to improve the precision.
230
249
  --use-blintdb Use blintdb v2 for symbol and disassembly-hash resolution. Defaults to true if the local database file exists.
250
+ --wasm-sbom Emit SBOM components from WebAssembly Component Model binaries using their imported WIT interface packages (e.g. wasi:cli@0.2.0) as exact evidence. Core modules without component-model evidence are skipped.
231
251
  ```
232
252
 
233
253
  </details>
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
+ from __future__ import annotations
3
4
 
4
5
  import argparse
5
6
  import os
@@ -19,21 +20,21 @@ BLINT_LOGO = """
19
20
  """
20
21
 
21
22
 
22
- def _callgraph_algorithms():
23
+ def _callgraph_algorithms() -> list[str]:
23
24
  """Return the registered callgraph match algorithm names."""
24
25
  from blint.lib.callgraph.algorithms import available_algorithms
25
26
 
26
27
  return available_algorithms()
27
28
 
28
29
 
29
- def _callgraph_default_algorithm():
30
+ def _callgraph_default_algorithm() -> str:
30
31
  """Return the default callgraph match algorithm name."""
31
32
  from blint.lib.callgraph.algorithms import DEFAULT_ALGORITHM
32
33
 
33
34
  return DEFAULT_ALGORITHM
34
35
 
35
36
 
36
- def build_args():
37
+ def build_args() -> argparse.Namespace:
37
38
  """
38
39
  Constructs command line arguments for the blint tool
39
40
  """
@@ -41,7 +42,7 @@ def build_args():
41
42
  return parser.parse_args()
42
43
 
43
44
 
44
- def build_parser():
45
+ def build_parser() -> argparse.ArgumentParser:
45
46
  parser = argparse.ArgumentParser(
46
47
  prog="blint",
47
48
  description="Binary linter and SBOM generator.",
@@ -56,6 +57,7 @@ def build_parser():
56
57
  db_mode=False,
57
58
  callgraph_match_mode=False,
58
59
  quiet_mode=False,
60
+ wasm_sbom=False,
59
61
  )
60
62
  parser.add_argument(
61
63
  "-i",
@@ -95,6 +97,22 @@ def build_parser():
95
97
  dest="no_reviews",
96
98
  help="Do not perform method reviews.",
97
99
  )
100
+ parser.add_argument(
101
+ "--no-wasm-strings",
102
+ action="store_false",
103
+ default=True,
104
+ dest="wasm_strings",
105
+ help="Do not extract strings from wasm files. Shrinks the wasm report "
106
+ "and disables the string-based wasm findings (e.g. WASM-STR-007).",
107
+ )
108
+ parser.add_argument(
109
+ "--no-wasm-call-graph",
110
+ action="store_false",
111
+ default=True,
112
+ dest="wasm_call_graph",
113
+ help="Do not build the wasm_tools call graph for wasm files. Shrinks "
114
+ "the wasm report and disables wasm callgraph exports.",
115
+ )
98
116
  parser.add_argument(
99
117
  "--suggest-fuzzable",
100
118
  action="store_true",
@@ -229,6 +247,15 @@ def build_parser():
229
247
  dest="use_blintdb",
230
248
  help=f"Use blintdb v2 for symbol and disassembly-hash resolution. Defaults to true if the file exists at {BLINTDB_LOC}. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.",
231
249
  )
250
+ sbom_parser.add_argument(
251
+ "--wasm-sbom",
252
+ action="store_true",
253
+ default=False,
254
+ dest="wasm_sbom",
255
+ help="Emit SBOM components from WebAssembly Component Model binaries "
256
+ "using their imported WIT interface packages (e.g. wasi:cli@0.2.0) as "
257
+ "exact evidence. Core modules without component-model evidence are skipped.",
258
+ )
232
259
  callgraph_match_parser = subparsers.add_parser(
233
260
  "callgraph-match",
234
261
  help="Match a source callgraph against a binary callgraph.",
@@ -422,7 +449,7 @@ def build_parser():
422
449
  return parser
423
450
 
424
451
 
425
- def parse_input(src):
452
+ def parse_input(src: str | list[str]) -> list[str]:
426
453
  """Parses the input source.
427
454
 
428
455
  This function takes the input source as a list and parses it to extract the
@@ -442,7 +469,7 @@ def parse_input(src):
442
469
  return [src]
443
470
 
444
471
 
445
- def handle_args(args=None):
472
+ def handle_args(args: argparse.Namespace | None = None) -> BlintOptions:
446
473
  """Handles the command-line arguments.
447
474
 
448
475
  This function parses the command-line arguments and returns a BlintOptions object
@@ -475,6 +502,9 @@ def handle_args(args=None):
475
502
  src_dir_image=args.src_dir_image,
476
503
  stdout_mode=args.stdout_mode,
477
504
  use_blintdb=args.use_blintdb,
505
+ wasm_sbom=args.wasm_sbom,
506
+ wasm_strings=args.wasm_strings,
507
+ wasm_call_graph=args.wasm_call_graph,
478
508
  disassemble=args.disassemble,
479
509
  render_mermaid_callgraph=args.render_mermaid_callgraph,
480
510
  export_callgraph_graphml=args.export_callgraph_graphml,
@@ -485,7 +515,7 @@ def handle_args(args=None):
485
515
  return blint_options
486
516
 
487
517
 
488
- def run_callgraph_match_command(args):
518
+ def run_callgraph_match_command(args: argparse.Namespace) -> None:
489
519
  """Run the callgraph-match subcommand from parsed CLI arguments."""
490
520
  from blint.lib.callgraph.command import run_callgraph_match
491
521
  from blint.lib.callgraph.match import options_for_profile
@@ -525,13 +555,13 @@ def run_callgraph_match_command(args):
525
555
  raise SystemExit(2) from exc
526
556
 
527
557
 
528
- def run_canonicalize_command(args):
558
+ def run_canonicalize_command(args: argparse.Namespace) -> None:
529
559
  """Run the canonicalize subcommand: show canonical forms of names."""
530
560
  import json as _json
531
561
 
532
562
  from blint.lib.callgraph.canon import canonicalize
533
563
 
534
- results = []
564
+ results: list[dict[str, str | bool]] = []
535
565
  for name in args.names:
536
566
  canon = canonicalize(name)
537
567
  results.append(
@@ -557,15 +587,15 @@ def run_canonicalize_command(args):
557
587
  table.add_column("Generic", no_wrap=True)
558
588
  for row in results:
559
589
  table.add_row(
560
- row["input"],
561
- row["canonical"] or "(empty)",
562
- row["kind"],
590
+ str(row["input"]),
591
+ str(row["canonical"] or "(empty)"),
592
+ str(row["kind"]),
563
593
  "yes" if row["is_generic"] else "no",
564
594
  )
565
595
  console.print(table)
566
596
 
567
597
 
568
- def main():
598
+ def main() -> None:
569
599
  """Main function of the blint tool"""
570
600
  args = build_args()
571
601
  if args.subcommand_name == "callgraph-match":