Skip to content

fix: v0.48.0 — ISO 26262-3 Table 4 ASIL fix + audit remediation - #89

Merged
SoundMatt merged 1 commit into
mainfrom
fix/audit-asil-table-and-security
Jul 30, 2026
Merged

fix: v0.48.0 — ISO 26262-3 Table 4 ASIL fix + audit remediation#89
SoundMatt merged 1 commit into
mainfrom
fix/audit-asil-table-and-security

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

A third-party audit surfaced a critical defect in hara.DetermineASIL plus several medium/low findings. This PR fixes all of them (except one deliberately left alone), bumps the version, and updates the changelog.

  • hara.DetermineASIL (Critical): the hand-written ISO 26262-3:2018 Table 4 lookup was wrong in 8/12 S2 cells and 11/12 S3 cells, always inflating the ASIL rating versus the standard's correct additive S+E+C model. Replaced with the reproducible additive rule: points = S(1-3) + E(1-4) + C(1-3), <=6 -> QM, 7 -> A, 8 -> B, 9 -> C, 10 -> D (ASIL D only at S3+E4+C3). hara/hara_test.go's golden values, which had locked in the inflated results, are corrected.
  • .fusa-hara.json re-derived under the fix — this repo's own dogfooded HARA (H-001..H-005) had over-classified ASILs as a direct consequence of the bug above; the highest ASIL among them drops from the previously-claimed ASIL-C to ASIL-B.
  • qualify.computeHash non-reproducible integrity hash: it hashed the live generatedAt timestamp and didn't sort Results before hashing. Now excludes generatedAt, canonicalizes via fusa.CanonicalizeJSON, and sorts results[] by case name first.
  • Git argument injection in impact.changedFiles: git diff was built from --from/--to refs with no -- pathspec separator, so a ref beginning with - could be interpreted as an option. Refs starting with - are now rejected, and -- is always inserted before the revision range.
  • Stale committed check-report.json (plain text, baked with an absolute local path) removed; .gitignore now covers check-report.json and results.sarif.
  • Legacy .fusa.json shape normalized to the current canonical form (configVersion plus top-level standard/asil).
  • CI SARIF self-scan masking: gofusa check --format sarif failures were unconditionally swallowed by || true before the upload step. Now only exit 0/1 (clean/findings-present) are treated as producing a valid SARIF; anything higher fails the job.

Deliberately not patched: Unicode NFC normalization in normalizeMessage — a correct fix needs golang.org/x/text, which conflicts with this repo's std-lib-only convention (go.mod has zero dependencies).

Test plan

  • go build ./...
  • go vet ./...
  • go test ./... (all packages pass)
  • gofmt -l . (clean)
  • Version bumped 0.47.0 -> 0.48.0 in fusa.go, README.md, docs/tool-safety-manual.md (CI's doc-version-consistency gate checks both)
  • CHANGELOG.md entry added
  • CI green on this PR

hara.DetermineASIL mis-implemented ISO 26262-3:2018 Table 4 (Critical):
8/12 S2 cells and 11/12 S3 cells were wrong, always inflating the rating
versus the standard's additive S+E+C model. Replaced with the correct
reproducible rule (points=S+E+C, S1-3/E1-4/C1-3, <=6 QM/7 A/8 B/9 C/10 D),
corrected the golden test values that had locked the bug in, and
re-derived this repo's own dogfooded .fusa-hara.json under the fix — the
highest ASIL among H-001..H-005 drops from the previously-claimed ASIL-C
to ASIL-B.

Also fixes: qualify.computeHash non-reproducible integrity hash
(embedded generatedAt, unsorted Results), a git argument-injection path
in impact.changedFiles (missing "--" pathspec separator ahead of
attacker-influenced refs), a stale check-report.json committed with an
absolute local path, the legacy .fusa.json shape (missing configVersion
and top-level standard/asil), and CI's SARIF self-scan step masking real
failures with "|| true".

Unicode NFC normalization in normalizeMessage remains deliberately
unpatched per the std-lib-only convention (would require
golang.org/x/text).

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Comment thread impact/impact.go
// interpreted by git as an option rather than a revision.
for _, ref := range []string{fromRef, toRef} {
if strings.HasPrefix(ref, "-") {
return nil, fmt.Errorf("impact: invalid ref %q: must not begin with '-'", ref)
@SoundMatt
SoundMatt merged commit d6c8ac6 into main Jul 30, 2026
16 checks passed
@SoundMatt
SoundMatt deleted the fix/audit-asil-table-and-security branch July 30, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants