Threat model¶
Review this model whenever an input format, output format, or dependency changes.
What the tool protects¶
The operator’s data. Inputs are CSV and JSON exports supplied by the operator. They can hold sensitive account, group, and configuration details, and so can the reports.
The integrity of results. Reviewers and assessors rely on the output as evidence.
The operator’s machine. The tool processes files that may come from systems the operator does not fully trust.
The supply chain. Users install release artifacts built by this project’s pipeline.
Trust boundaries¶
Input files enter the tool. They are untrusted.
Output files leave the tool and are opened in browsers, spreadsheets, and review systems.
Release artifacts leave the build pipeline and are installed by users.
Threats and controls (STRIDE)¶
The Status column says whether each control is in place today. Branch rules depend on repository settings, which are applied outside the code.
Category |
Threat |
Control |
Status |
|---|---|---|---|
Spoofing |
A tampered release artifact is installed in place of the real one. |
Releases are built once by the release workflow from a commit on |
In place (attestations when public) |
Tampering |
A crafted input file changes results, for example by injecting duplicate keys, changing identifier types, or using invalid Unicode that a lossy cleanup would merge. |
Values are never converted or altered. Duplicate and ambiguous keys are findings. Duplicate column names, duplicate JSON properties, and unpaired surrogates, whether from a JSON escape or a CSV text encoding, are input errors. Every finding links to its source record. |
In place |
Tampering |
A malicious change enters the code base. |
Pull requests only, a required passing check, resolved conversations, no force pushes to |
In place (branch rules need settings) |
Repudiation |
A user cannot show which inputs and rules produced a report. |
Reports record the tool version, the SHA-256 of each input and of the profile, the rules applied, and the reference time. |
In place |
Information disclosure |
Reports leak more data than needed, or test fixtures contain real data. |
Reports include only keys and compared fields, never whole records. Report files are created readable only by the current user on Linux and macOS, and are never silently overwritten. Fixtures are synthetic. Secret scanning runs on every change and across the full history. |
In place |
Tampering |
A failed or interrupted run leaves partial reports, or overwrites good evidence. |
Reports are written to private temporary files first. Without |
In place |
Spoofing |
Input text disguises itself on screen, for example with terminal escape sequences or right-to-left overrides that make |
Control, format (zero-width and bidirectional), separator, filler, tag, variation selector, and lone surrogate characters appear as visible escapes in the terminal and in HTML, Markdown, and CSV reports. The terminal also shows a carriage return and a tab as escapes, and every name from a file, a profile, or the command line (the profile name, input file names, report paths, error messages) is printed as a single line with a line feed shown as |
In place |
Repudiation |
A crash is mistaken for a normal result in a pipeline. |
Unexpected errors exit with code 4, distinct from findings (1) and input errors (3). Empty inputs are reported as findings rather than passing cleanly. |
In place |
Information disclosure |
The tool sends data over the network. |
No network code and no telemetry. |
In place |
Denial of service |
Oversized, sparse, or deeply nested inputs exhaust memory or time. |
A per-file size limit (256 MiB by default) enforced while reading, a 1 MiB limit per CSV field, a 1 MiB limit for profiles (the profile must be a regular file, and the limit applies to the bytes actually read from the opened file, so a pipe or a file that grows cannot get past it; an integer with more digits than the interpreter allows, about 4,300, and a profile nested too deeply are profile errors, exit 3), and a 64-level limit on nested JSON values. Records store only the fields present, so files whose rows have different columns stay proportional in memory. The size limit is on bytes, not records: memory is about 650 to 1,100 bytes per record, which is 14 to 80 times the file size depending on row width (see the limitations page), so the default limit does not by itself keep a very narrow file within a small host. pakad reads no XML. |
Partly in place: the memory a given file needs is not bounded by the byte limit |
Elevation of privilege |
Input content runs as code: formula injection in CSV output, or script or markup injection in HTML and Markdown output. |
Formula neutralization of every CSV cell, including full-width trigger characters. HTML escaping of every value plus a content security policy that blocks scripts, network requests, and forms. Markdown escaping of every value. No |
In place |
Elevation of privilege |
A compromised dependency or build step runs with broad permissions. |
One runtime dependency, |
In place |
Residual risks¶
The tool cannot detect data that a source system never exported. Reports state this limit.
Checksums and attestations protect users only if they verify them. Releasing shows how.