v0.2.0
Minor Changes
-
#5
db305e6Thanks @toiroakr! - Catalog overhaul:- Add
rules_catalog.mdas a human-readable mirror ofrules_catalog.mbt,
with upstream documentation links, status, severity, and per-rule notes
on the five consolidations and on every planned/not-planned rule. - Introduce a third
Statusvariant,NotPlanned, for rules that are
documented but deliberately out of scope. Demoteshellcheckand
pyflakes(Cloudflare Workers cannot ship the native binaries),
ref-confusion(cannot occur onceunpinned-usesmandates SHA pins),
andstale-action-refs(GitHub API cost not worth the informational
signal) toNotPlannedand drop their#skip("not implemented yet")
fixtures. Coverage test now only requires fixtures for
Implemented/Plannedentries. AGENTS.md(andCLAUDE.md, now a symlink to it) gains a "Rule catalog
discipline" section requiringrules_catalog.mbtandrules_catalog.md
to be updated together.
- Add
-
#8
bfa0c9cThanks @toiroakr! - Allow specifyingorg/repo/commit[/target/path/...]directly in the request
URL path (e.g.GET /actions/checkout/<sha>/action.yml, or with nested
targets like.github/workflows/ci.yml), and require a commit SHA whenever
repomode is used. Thecommitparameter accepts 7–64 hex characters,
so non-hex branch/tag names (e.g.main,v1.2.3) are rejected outright.
Hex-shaped refs are still accepted at face value, so an all-hex branch or
tag (e.g.deadbee) can collide with a short-SHA-shaped commit; callers
needing guaranteed immutability should pass the full 40-char SHA. Path
segments that don't match the repo-mode shape are ignored, so the Worker
can be served under arbitrary path prefixes (/api/...,/favicon.ico,
etc.) without bricking unrelated requests. Responses inrepomode now
include the resolvedcommitalongsiderepoandtargets.Path-based targets bypass the comma-delimited
targets=parsing, so a
literal,in a path no longer splits one file into two. Each target path
is also validated to reject.., absolute, backslash, and percent-encoded
forms that could escape the pinned<commit>prefix once interpolated
into theraw.githubusercontent.comURL.
Patch Changes
-
#9
800c4f6Thanks @toiroakr! - Harden DoS/ReDoS surface:- Replace the recursive backtracking glob matcher behind the
disable=
parameter with a two-pointer "last-star backtrack" algorithm, so
adversarial patterns such as*a*a*…*bagainst long inputs can no
longer cause exponential CPU usage. (The matcher is not strictly
linear — worst case isO(m·n)— but thedisable=caps below keep
the bound small enough that DoS via this path is not feasible.) - Cloudflare Worker now enforces a 1 MiB cap on request bodies and on
files fetched inrepomode. Oversized direct payloads short-circuit
with413 Payload Too Largebefore reaching the parser / rules.
Inrepomode the request still returns200with the per-file
error surfaced underfiles[].errorso a single oversized file does
not invalidate results for the rest of the batch. disable=patterns are limited to one*each (more than one returns
400), and capped at 64 patterns × 128 characters per pattern.targets=(inrepomode) is capped at 50 paths. Requests over the
cap are rejected with400rather than silently truncated, so clients
don't get anok:trueresponse that quietly skipped files.- Add a 60 req/min per-IP rate limit via the Workers Rate Limiting
binding. Traffic from GitHub-hosted Actions runners is exempt
because runners share egress IPs across unrelated tenants; the
allow-list is sourced fromapi.github.com/metaand refreshed daily
by a Cron Trigger into a KV namespace, with the request path reading
from KV (memoized per isolate) and a one-shot direct-fetch fallback
for the cold-deploy case. Over-limit requests get429. - Deploy note: this introduces a
KVnamespace and atriggers.crons
entry incf/wrangler.jsonc. Runnpx wrangler kv namespace create karinto-metaonce and paste the returned id into both the top-level
andenv.stagingkv_namespacesblocks — production and staging
share the namespace because the/metapayload is GitHub-published
and identical across envs. - Regression test exercises the previously catastrophic pattern.
- Replace the recursive backtracking glob matcher behind the