Skip to content

Commit cfded8f

Browse files
pjsteinclaude
andcommitted
Bun, erlang certifi and CPython fixes; four test hosts; engines ranges; caveats; checklist refresh
From the advisory (2026-10-23) and a review on mlabs-remix#1595: - Bun 1.4.4 and erlang certifi 2.18.0 are fixed: Bun image tags, CI pins, package.json pins (engines.bun, packageManager, the bun package) and the host binary are now version checks; a major-only tag (oven/bun:1) that resolves to the newest release counts as floating, not below the fix - CPython 3.13.17 / 3.14.9 / 3.15.1: image tag and host interpreter checks - probes cover all four test hosts, including the two no-CT variants - engines.node ranges that admit a fixed release (24, 24.x) are no longer reported; Firebase requires the bare major - the in-image probe adds Bun and Deno clients and names every client tested - packs can declare caveats about a fixed release; the Node 24.22.1 chunked streaming regression (nodejs/node#66781) is shown in PR bodies that move to it - re-running fix on an open PR rebuilds its 'Still needs a human' section and caveats from current findings Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 29ebb9c commit cfded8f

11 files changed

Lines changed: 310 additions & 94 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ a script, model weights fetched from a bucket): build it the way the project doe
103103
touched plus every Dockerfile whose `COPY`/`ADD` inputs include a file it changed (a
104104
lockfile bump changes the image even when the Dockerfile does not). Inside each built image
105105
it fetches the advisory's test hosts with every TLS client present (curl or wget, Python's
106-
default context, certifi, Node, Java), then with every CA bundle file on disk as an explicit
106+
default context, certifi, Node, Bun, Deno, Java), and names each one in the result, then with every CA bundle file on disk as an explicit
107107
trust store: certifi, gRPC's `roots.pem`, httplib2, botocore, the system bundle. The image
108108
passes only if every bundle the image actually uses refuses. A bundle that is present but
109109
bypassed is reported, not counted: pip's private certifi (only pip installs read it), an

‎internal/engine/engine.go‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,15 @@ func classify(p *pack.Pack, d *pack.Detector, table, ver string) (state findings
175175
return findings.Floating, p.Latest(table)
176176
}
177177
if floor, ok := p.Versions[table]["*"]; ok {
178-
// single-floor table (certifi, deno): any parsed version compares against the floor
178+
// single-floor table (certifi, deno, bun): any parsed version compares against the floor
179179
if floor == "pending" {
180180
return findings.Unknown, ""
181181
}
182+
// a short tag that is a prefix of the floor (bun:1 for 1.4.4) resolves to the newest
183+
// release on that line when pulled: floating, not below the fix. bun:1.2 is not a prefix.
184+
if version.Parts(num) < d.PinParts && strings.HasPrefix(floor, num+".") {
185+
return findings.Floating, floor
186+
}
182187
if version.Less(num, floor) {
183188
return findings.Vulnerable, floor
184189
}

‎internal/fix/fix.go‎

Lines changed: 84 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ type Options struct {
3232
}
3333

3434
type Edit struct {
35-
File string
36-
Line int
37-
Before string
38-
After string
39-
Why string
35+
File string
36+
Line int
37+
Before string
38+
After string
39+
Why string
40+
Detector string
4041
}
4142

4243
type ToolRun struct {
@@ -289,7 +290,7 @@ func (r *remediator) rewrite(f findings.Finding) {
289290
}
290291
r.files[f.File][i] = after
291292
r.dirty[f.File] = true
292-
r.res.Edits = append(r.res.Edits, Edit{f.File, i + 1, old, after, why(f)})
293+
r.res.Edits = append(r.res.Edits, Edit{f.File, i + 1, old, after, why(f), f.Detector})
293294
r.refreshComment(f.File, i, f.Replace, f.FixText)
294295
}
295296

@@ -351,7 +352,7 @@ func (r *remediator) refreshComment(rel string, i int, oldVer, newVer string) {
351352
n = isoDate.ReplaceAllString(n, time.Now().Format("2006-01-02"))
352353
}
353354
lines[j] = n
354-
r.res.Edits = append(r.res.Edits, Edit{rel, j + 1, l, n, "comment named the old pin"})
355+
r.res.Edits = append(r.res.Edits, Edit{rel, j + 1, l, n, "comment named the old pin", ""})
355356
return
356357
}
357358
}
@@ -394,7 +395,7 @@ func (r *remediator) insertAfter(f findings.Finding) {
394395
lines = append(lines[:i+1], append(ins, lines[i+1:]...)...)
395396
r.files[f.File] = lines
396397
r.dirty[f.File] = true
397-
r.res.Edits = append(r.res.Edits, Edit{f.File, i + 1 + len(ins), "", strings.Join(ins, " / "), why(f)})
398+
r.res.Edits = append(r.res.Edits, Edit{f.File, i + 1 + len(ins), "", strings.Join(ins, " / "), why(f), f.Detector})
398399
}
399400

400401
func (r *remediator) flush() {
@@ -594,15 +595,14 @@ func (r *remediator) commitAndPR(name string) {
594595
// appendToExistingBody adds this run's edits and lockfile commands to an open PR's body, so
595596
// its table of changes stays complete when a later pack version adds rules.
596597
func (r *remediator) appendToExistingBody(url string) {
597-
if len(r.res.Edits) == 0 && len(r.res.Tools) == 0 {
598-
return
599-
}
600598
cur, err := exec.Command("gh", "pr", "view", url, "--json", "body", "-q", ".body").Output()
601599
if err != nil {
602600
return
603601
}
604602
var b strings.Builder
605-
fmt.Fprintf(&b, "\n## Additional changes (%s)\n\n", time.Now().Format("2006-01-02"))
603+
if len(r.res.Edits) > 0 || len(r.res.Tools) > 0 {
604+
fmt.Fprintf(&b, "\n## Additional changes (%s)\n\n", time.Now().Format("2006-01-02"))
605+
}
606606
if len(r.res.Edits) > 0 {
607607
b.WriteString("| File | Line | Before | After | Why |\n|---|---|---|---|---|\n")
608608
for _, e := range r.res.Edits {
@@ -619,6 +619,9 @@ func (r *remediator) appendToExistingBody(url string) {
619619
} else {
620620
body += b.String()
621621
}
622+
body = replaceSection(body, "Known caveats", strings.TrimSuffix(CaveatsSection(r.p, r.res.Edits, r.res.Tools), "\n"))
623+
// the checklist reflects the current findings: items a newer pack no longer reports go away
624+
body = replaceSection(body, "Still needs a human (not changed by this PR)", strings.TrimSuffix(ManualSection(r.res.Manual), "\n"))
622625
tmp, err := os.CreateTemp("", "fumigator-body-*.md")
623626
if err != nil {
624627
return
@@ -631,6 +634,27 @@ func (r *remediator) appendToExistingBody(url string) {
631634
}
632635
}
633636

637+
// replaceSection swaps the body of "## heading" (up to the next "## " or the footer) for
638+
// content, which is a full section with its heading, or "" to drop it. A missing section is
639+
// added before "## Verify before merging" when content is non-empty.
640+
func replaceSection(body, heading, content string) string {
641+
re := regexp.MustCompile(`(?s)\n## ` + regexp.QuoteMeta(heading) + `\n.*?(\n## |\n🤖|\z)`)
642+
if loc := re.FindStringSubmatchIndex(body); loc != nil {
643+
repl := ""
644+
if content != "" {
645+
repl = "\n" + strings.TrimRight(content, "\n") + "\n"
646+
}
647+
return body[:loc[0]] + repl + body[loc[2]:]
648+
}
649+
if content == "" {
650+
return body
651+
}
652+
if i := strings.Index(body, "\n## Verify before merging"); i >= 0 {
653+
return body[:i] + "\n" + strings.TrimRight(content, "\n") + "\n" + body[i:]
654+
}
655+
return body + "\n" + content
656+
}
657+
634658
// Body renders the PR body: why (from the pack), every edit, lockfiles, the human checklist,
635659
// and the pack's verification probes.
636660
func Body(p *pack.Pack, name string, res *Result) string {
@@ -652,24 +676,58 @@ func Body(p *pack.Pack, name string, res *Result) string {
652676
}
653677
b.WriteString("\n")
654678
}
655-
if len(res.Manual) > 0 {
656-
b.WriteString("## Still needs a human (not changed by this PR)\n\n")
657-
for _, f := range res.Manual {
658-
loc := f.File
659-
if f.Line > 0 {
660-
loc = fmt.Sprintf("%s:%d", f.File, f.Line)
679+
b.WriteString(CaveatsSection(p, res.Edits, res.Tools))
680+
b.WriteString(ManualSection(res.Manual))
681+
b.WriteString(VerifySection(p, res))
682+
b.WriteString("\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n")
683+
return b.String()
684+
}
685+
686+
// ManualSection renders "Still needs a human" from the current manual findings; "" when none.
687+
func ManualSection(manual []findings.Finding) string {
688+
if len(manual) == 0 {
689+
return ""
690+
}
691+
var b strings.Builder
692+
b.WriteString("## Still needs a human (not changed by this PR)\n\n")
693+
for _, f := range manual {
694+
loc := f.File
695+
if f.Line > 0 {
696+
loc = fmt.Sprintf("%s:%d", f.File, f.Line)
697+
}
698+
to := f.Fixed
699+
if to == "" {
700+
to = "—"
701+
}
702+
fmt.Fprintf(&b, "- [ ] **%s** `%s` — %s (%s): %s → %s. %s\n", f.Severity, loc, f.Detector, f.State, f.Current, to, f.Note)
703+
}
704+
b.WriteString("\n")
705+
return b.String()
706+
}
707+
708+
// CaveatsSection renders the pack's caveats that apply to these edits; "" when none.
709+
func CaveatsSection(p *pack.Pack, edits []Edit, tools []ToolRun) string {
710+
var out []string
711+
for _, c := range p.Caveats {
712+
hit := false
713+
for _, e := range edits {
714+
if slices.Contains(c.Detectors, e.Detector) && (c.When == "" || strings.Contains(e.After, c.When)) {
715+
hit = true
661716
}
662-
to := f.Fixed
663-
if to == "" {
664-
to = "—"
717+
}
718+
for _, t := range tools {
719+
if slices.Contains(c.Detectors, t.Finding.Detector) && (c.When == "" || strings.Contains(t.Finding.Fixed, c.When)) {
720+
hit = true
665721
}
666-
fmt.Fprintf(&b, "- [ ] **%s** `%s` — %s (%s): %s → %s. %s\n", f.Severity, loc, f.Detector, f.State, f.Current, to, f.Note)
667722
}
668-
b.WriteString("\n")
723+
if hit {
724+
out = append(out, "- "+strings.TrimSpace(c.Text))
725+
}
669726
}
670-
b.WriteString(VerifySection(p, res))
671-
b.WriteString("\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n")
672-
return b.String()
727+
if len(out) == 0 {
728+
return ""
729+
}
730+
return "## Known caveats\n\n" + strings.Join(out, "\n") + "\n\n"
673731
}
674732

675733
// VerifySection renders the "Verify before merging" checklist: CI, a build of each Dockerfile

‎internal/fix/lockfiles_test.go‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package fix
22

3-
import "testing"
3+
import (
4+
"strings"
5+
"testing"
6+
)
47

58
func TestCommandFor(t *testing.T) {
69
chain := "uvx [email protected] lock --upgrade-package grpcio || poetry update grpcio || pdm update grpcio"
@@ -50,3 +53,15 @@ func TestHashPinned(t *testing.T) {
5053
t.Error("plain pin is not hash-pinned")
5154
}
5255
}
56+
57+
func TestReplaceSection(t *testing.T) {
58+
body := "## Why\n\nx\n\n## Still needs a human (not changed by this PR)\n\n- [ ] old\n\n## Verify before merging\n\n- [ ] CI\n\n🤖 Generated"
59+
got := replaceSection(body, "Still needs a human (not changed by this PR)", "")
60+
if strings.Contains(got, "old") || !strings.Contains(got, "## Verify before merging") {
61+
t.Errorf("drop section:\n%s", got)
62+
}
63+
got = replaceSection(body, "Known caveats", "## Known caveats\n\n- c")
64+
if !strings.Contains(got, "## Known caveats\n\n- c\n\n## Verify before merging") && !strings.Contains(got, "## Known caveats\n\n- c\n## Verify") {
65+
t.Errorf("add section before verify:\n%s", got)
66+
}
67+
}

‎internal/pack/pack.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type Pack struct {
3333
Strings map[string][]string `yaml:"strings"`
3434

3535
Detectors []Detector `yaml:"detectors"`
36+
Caveats []Caveat `yaml:"caveats"`
3637
Host []HostCheck `yaml:"host"`
3738
Verify []Probe `yaml:"verify"`
3839

@@ -99,6 +100,14 @@ type Fix struct {
99100
Command string `yaml:"command"` // tool: shell command; {fixed} {name} interpolated
100101
}
101102

103+
// Caveat is a known problem with a fixed release, rendered in a PR body when one of Detectors
104+
// made an edit (and, when When is set, the edit's new text contains it).
105+
type Caveat struct {
106+
Detectors []string `yaml:"detectors"`
107+
When string `yaml:"when"`
108+
Text string `yaml:"text"`
109+
}
110+
102111
// HostCheck queries one collector table on the local machine, osquery-style: rows are filtered
103112
// by Where (literal or "re:" regex per column), then either a Version comparison classifies each
104113
// row (vulnerable / eol / floating / ok / unknown) or, with no Version, every matching row is

‎internal/verify/verify.go‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"os/exec"
1414
"path/filepath"
1515
"regexp"
16+
"slices"
1617
"strings"
1718
"time"
1819

@@ -373,6 +374,12 @@ for u in "$@"; do
373374
if command -v node >/dev/null 2>&1; then
374375
node -e "fetch(process.argv[1]).then(()=>process.exit(0),()=>process.exit(1))" "$u" 2>/dev/null && ok_fetch client node "$u" || ok_reject client node "$u"
375376
fi
377+
if command -v bun >/dev/null 2>&1; then
378+
bun -e "await fetch(process.argv[1])" "$u" >/dev/null 2>&1 && ok_fetch client bun "$u" || ok_reject client bun "$u"
379+
fi
380+
if command -v deno >/dev/null 2>&1; then
381+
deno eval "await fetch(Deno.args[0])" "$u" >/dev/null 2>&1 && ok_fetch client deno "$u" || ok_reject client deno "$u"
382+
fi
376383
if command -v java >/dev/null 2>&1; then
377384
d=$(mktemp -d 2>/dev/null || echo /tmp/fv$$); mkdir -p "$d"
378385
printf 'public class T{public static void main(String[] a)throws Exception{new java.net.URL(a[0]).openStream().close();}}' > "$d/T.java"
@@ -439,6 +446,8 @@ func probeImage(tag, df string, urls []string) []Step {
439446
checked int
440447
fetched []string
441448
pipFetched []string // bypassed bundles that still list the roots, with the reason
449+
clients []string
450+
bundles int
442451
}
443452
per := map[string]*res{}
444453
for _, u := range urls {
@@ -464,6 +473,11 @@ func probeImage(tag, df string, urls []string) []Step {
464473
continue
465474
}
466475
r.checked++
476+
if f[1] == "client" && !slices.Contains(r.clients, f[2]) {
477+
r.clients = append(r.clients, f[2])
478+
} else if f[1] == "bundle" {
479+
r.bundles++
480+
}
467481
if f[4] == "FETCHED" {
468482
label := f[2]
469483
if why := bypassed(f[2], uses); f[1] == "bundle" && why != "" {
@@ -491,7 +505,7 @@ func probeImage(tag, df string, urls []string) []Step {
491505
st.Detail = "STILL TRUSTS in " + df + ": " + strings.Join(r.fetched, "; ")
492506
default:
493507
st.Ran, st.Passed = true, true
494-
st.Detail = fmt.Sprintf("rejected by all %d client and bundle checks in %s", r.checked-len(r.pipFetched), df)
508+
st.Detail = fmt.Sprintf("rejected in %s by every client (%s) and all %d CA bundles in use", df, strings.Join(r.clients, ", "), r.bundles-len(r.pipFetched))
495509
}
496510
if len(r.pipFetched) > 0 {
497511
st.Detail += ". Unused bundles that still list the roots: " + strings.Join(r.pipFetched, "; ")

0 commit comments

Comments
 (0)