Skip to content

fleet-status check: the evaluator reads own properties only - #219

Merged
askalf merged 1 commit into
mainfrom
fns-own-keys
Nov 13, 2026
Merged

askalf merged 1 commit into
mainfrom
fns-own-keys

Conversation

@askalf

@askalf askalf commented Nov 13, 2026

Copy link
Copy Markdown
Owner

The Fuzz run on 2026-11-13 (run 43463587459) crashed fuzz/workflow_check.fuzz.js with TypeError: fns[k.v] is not a function. The input contained __proto__(...): fns[k.v] found Object.prototype through __proto__, passed the unknown-function check, and was then called. The fuzz contract says the evaluator returns a value or throws a plain Error, never a TypeError from its own parser.

The same lookup let toString() and constructor() run as JavaScript built-ins. A context named constructor (and k.v in ctx under strict), a matrix.constructor key, and paths like github.event.constructor also reached Object.prototype. GitHub Actions has no such function, context or property.

Change (scripts/fleet-status/check.mjs): one own(o, key) helper (Object.hasOwn on the value) guards every lookup by a name taken from the expression:

  • functions: an unknown name is a plain Error('unknown function …');
  • contexts: a missing one is null, or unknown context under strict;
  • matrix keys under strict, and the trusted check of github's own properties;
  • property and index access: a missing own property is null.

Strings and arrays keep their own indexes and length.

Tests (scripts/fleet-status/check.test.mjs): four new checks, 179 pass. Three of them fail on main. Replaying the fuzzer's saved crash input through the fuzz target is clean with the change and throws the same TypeError without it.

The fuzzer (run 43463587459) found `__proto__(...)` passing the function
check through Object.prototype and throwing a TypeError, which the fuzz
contract forbids: the evaluator returns a value or throws a plain Error.
toString(), a context named constructor and paths like
github.event.constructor reached Object.prototype the same way and read as
built-ins where Actions has no such function, context or property.

Every lookup by a name from the expression now checks own properties: an
unknown function is a plain Error, a missing context or property null (or
an Error under strict), and under trusted a github property the caller did
not supply stays UNKNOWN. The fuzzer's crash input replays clean.

@sprayberry-redline sprayberry-redline left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve. The evaluator now limits expression-derived function, context, matrix, and property lookups to own properties, preventing inherited JavaScript members from being invoked or read. The added coverage exercises inherited-name rejection, strict and trusted handling, and legitimate string and array properties.

@askalf
askalf merged commit f0be701 into main Nov 13, 2026
15 checks passed
@askalf
askalf deleted the fns-own-keys branch November 13, 2026 19:30
askalf pushed a commit to askalf/pitlane that referenced this pull request Nov 14, 2026
Moves this repository's askalf/ci pins (its reusable workflow calls,
their redline-ref inputs and any action pins) to
askalf/ci@f0be701, the main commit that
last changed the review, the fix or an action (main 2026-11-14,
askalf/ci#219). The scripts are fetched at that same commit. The pins
are the only change.

---------

Co-authored-by: askalf-pin-bump[bot] <352119504+askalf-pin-bump[bot]@users.noreply.github.com>
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