Skip to content

fix: v1.148.0 — ISO 26262 Table 4 ASIL bug + unauth arbitrary-file-read + 13 other audit findings - #104

Merged
SoundMatt merged 2 commits into
mainfrom
fix/audit-round3-asil-and-security
Jul 30, 2026
Merged

SoundMatt merged 2 commits into
mainfrom
fix/audit-round3-asil-and-security

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

An external third-party audit of the whole x-FuSa ecosystem was checked
finding-by-finding against this repo's live source before applying any
patch — every claim below was independently reconfirmed by hand-computing
the ISO 26262-3:2018 Table 4 truth table and by reading the actual
vulnerable code paths, not taken on the audit's word.

  • Critical: hara.DetermineASIL mis-implemented ISO 26262-3:2018 Table 4
    — every S2/S3 cell (S1 already correct) was inflated by 1-2 ASIL levels
    versus the standard's additive S+E+C derivation (e.g. S3/E1/C2 returned
    ASIL-B instead of QM). hara_test.go hard-coded the wrong values,
    locking the bug in. Fixed the table, rewrote the test from the canonical
    36-cell truth table, and regenerated .fusa-hara.json (max hazard ASIL
    is now B, not C) and .fusa.json (ASIL-B, canonical
    configVersion/top-level standard+asil shape).
  • Security (Medium): serve runs unauthenticated by default, and
    /api/v1/diff?baseline=<path> took an unvalidated filesystem path —
    arbitrary file read. Sandboxed to the project root.
  • Security (Low): Basic Auth credential comparison was not
    constant-time.
  • Spec-compliance (Medium): qualify.hash included the live
    generatedAt timestamp and unsorted components — never reproducible
    run-to-run. Now blanks the timestamp and sorts before hashing.
  • Spec-compliance (Low): sas never wrote its sas.md companion.
  • Plus 13 smaller fixes: vv self-attestation discounting, atomic history
    writes, webhook timeout, decision-coverage mislabeling, diff fingerprint
    language-qualification, scheduler stop-channel leak,
    SOURCE_DATE_EPOCH support, configurable skip-dirs, EndLine/
    EndColumn, two invented standard-clause citations, doc/spec-version
    drift, non-gating CI steps.
  • Deliberately not patched: Unicode NFC normalization (would require
    golang.org/x/text, violating this repo's std-lib-only rule); image/
    Action digest pinning (needs live registry lookups not derivable
    offline).

Test plan

  • go build ./...
  • go vet ./...
  • go test ./... — all packages pass
  • gofmt -l . — clean
  • CI green (pending)

…ad + 13 other audit findings

An external audit's findings were each independently reconfirmed against
live source before patching. Highlights:

- hara.DetermineASIL mis-implemented ISO 26262-3:2018 Table 4 (S2/S3 cells
  inflated 1-2 ASIL levels, S1 correct); hara_test.go locked in the wrong
  values. Replaced with the canonical additive S+E+C table and rewrote
  tests from a 36-cell truth table. Regenerated .fusa-hara.json (max
  hazard ASIL is now B, not C) and .fusa.json (ASIL-B, canonical
  configVersion/standard/asil shape).
- serve ran unauthenticated by default with /api/v1/diff?baseline=<path>
  taking an unvalidated filesystem path — sandboxed to project root.
- Basic Auth credential compare was not constant-time.
- qualify.hash included the live generatedAt timestamp and unsorted
  components, so it was never reproducible run-to-run.
- sas never wrote its sas.md companion, only JSON.
- Plus: vv self-attestation discounting, atomic history writes, webhook
  timeout, decision-coverage mislabeling, diff fingerprint language
  qualification, scheduler stop-channel leak, SOURCE_DATE_EPOCH support,
  configurable skip-dirs, EndLine/EndColumn, two invented standard clause
  citations, doc/spec-version drift, non-gating CI steps.

Deliberately not patched (violates std-lib-only, or needs live registry
lookups not derivable offline): Unicode NFC normalization; image/Action
digest pinning.

Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com>
Comment thread server/server.go Fixed
Comment thread adapter/adapter.go
// before running detection.
//
//fusa:req REQ-FO-ADP004
var DefaultSkipDirs = map[string]bool{
Comment thread adapter/adapter.go
// before running detection.
//
//fusa:req REQ-FO-ADP004
var DefaultSkipDirs = map[string]bool{
Comment thread history/history.go
// storeMu serialises the non-atomic read-modify-write of the history file so
// concurrent compute paths (startup, scheduler, /refresh) cannot race and lose
// or corrupt snapshots.
var storeMu sync.Mutex
Follow-up to the prior commit's webhook timeout fix — the linter
correctly flagged the new http.NewRequest call for not carrying a
context. The http.Client.Timeout already bounds every attempt, so
context.Background() is sufficient here.

Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 01d2272 into main Jul 30, 2026
14 checks passed
@SoundMatt
SoundMatt deleted the fix/audit-round3-asil-and-security branch July 30, 2026 19:52
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