Skip to content

chore: #264 follow-ups (changeset ranges, a dictionary type, a shadowed list) - #273

Merged
thomasfosterau merged 2 commits into
trunkfrom
issue-260-security-followup
Oct 8, 2026
Merged

thomasfosterau merged 2 commits into
trunkfrom
issue-260-security-followup

Conversation

@thomasfosterau

@thomasfosterau thomasfosterau commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #264. Refs #260.

Three items from the security re-review of #264, plus a headline correction from the review of this PR. None changes behaviour.

  1. Changeset ranges. .changeset/undeclared-query-params.md (pending, unreleased) gave one affected range, 0.1.0–0.16.3, for both defects. Each defect now has its own range:

    • The prototype pollution through nest affects 0.1.0–0.16.3. nest in src/internal/codecs.ts already exists at the @thomasfosterau/effect-jsonapi@0.1.0 tag, with the same ??= {} group write.

    • The filter grammar's Object.prototype 500 affects 0.13.0–0.16.3. git log --diff-filter=A -- src/internal/filter.ts gives f59b77c (E3 Query.filter codec: URL ⇄ filter AST with error pointers #86, "Add the filter URL codec, filter AST and error pointers"). git tag --contains f59b77c starts at @thomasfosterau/effect-jsonapi@0.13.0, and the file is absent from the 0.12.0 tree. The 0.13.0 CHANGELOG lists f59b77c as the filter: true codec, and its filter.ts already has the plain fields[field] lookups that fix(Query): drop undeclared query parameters when the query declares nothing (#260) #264 replaced.

    • The headline now counts three defects, not two. The PR also fixes the bare/bracket key collision in nest (bug: an endpoint whose query declares nothing passes every parameter to its handler, and ?x=1&x[y]=2 is a 500 #260's title bug), a third request-triggerable 500: nest's ??= {} group write followed by an assignment onto a string throws in strict ESM. It hits the same no-family endpoints over the same range, 0.1.0–0.16.3. I checked this against the published 0.1.0 and 0.16.3 packages from npm: Query.schema(R, {}) for a resource with no relationships throws TypeError: Cannot create property ... on string when a bare key precedes its bracket form, on both versions. The headline now reads "A prototype-pollution vulnerability (CWE-1321) and a request-triggerable 500 on endpoints whose query declares no family … affect versions 0.1.0–0.16.3; a second request-triggerable 500, in the filter: true grammar … affects versions 0.13.0–0.16.3".

    The wording still contains no request payload. It names no fixed version, because whether the fix ships as 0.17.0 or as a backported 0.16.4 is the owner's decision.

  2. no-unsafe-dictionary-type in nest. fix(Query): drop undeclared query parameters when the query declares nothing (#260) #264 added const made: Record<string, unknown> = {}, and the linter didn't report it because Record is now imported from effect, which shadows the global name. The annotation is gone. The as Record<string, unknown> cast after Option.getOrElse (the same cast as before fix(Query): drop undeclared query parameters when the query declares nothing (#260) #264) already types the group. A local interface or an index-signature alias would not help, because the rule also reports an unknown-valued index signature.

    • I checked the rule's true count by temporarily aliasing the effect import as R in codecs.ts, filter.ts and Query.ts. The pre-fix(Query): drop undeclared query parameters when the query declares nothing (#260) #264 base (b1d774b^1) has 94. Trunk with the alias has 95, and the extra site is codecs.ts:192:21, which is made. This branch with the alias has 94.
    • I then reverted the alias. Keeping it would surface seven older masked sites (five in codecs.ts, two in Query.ts) as visible no-unsafe-dictionary-type warnings. With the four no-known-value-widening sites the same alias unmasks, 11 warnings appear in total across rules (4353 → 4364), so it is not lint-neutral. The visible vp lint output is identical to trunk's (4353 warnings).
  3. Shadowed inherited. src/Query.filter.test.ts declared a second inherited list inside a describe block, with the same five keys as the module-level one at line 45. The inner one is deleted. The two it.each(inherited) blocks still run once for each of constructor, __proto__, toString, hasOwnProperty and valueOf (10 cases, all passing).

Verification

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass (0 errors, 4353 warnings, the same as trunk)
  • vp run check (sources, type-level tests, examples, emitted declarations): pass ("every type gate green")
  • vp run -r test:unit: pass (root 2254/2254; every example suite passes)
  • vp run docgen (every JSDoc @example compiled and executed): pass
  • fallow audit --format json --quiet --explain --gate-marker agent: verdict pass
  • fallow audit --base origin/trunk: pass ("No issues in 3 changed files"; 3 inherited findings excluded)

Re-run in this order on the headline-correction commit, with the same results.

Changeset

No new changeset. Item 1 corrects the text (affected ranges and the defect count in the headline) of the existing, still-pending .changeset/undeclared-query-params.md (patch), and items 2 and 3 are lint and test hygiene.

  • A changeset under .changeset/ for every change to published behaviour (no published behaviour changes)

Notes

  • For the owner: the changeset still names no fixed version. Choosing between 0.17.0 and a backported 0.16.4 is your call.
  • No exported signature, declaration emit or effect peer range changes.

🤖 Generated with Claude Code


Generated by Claude Code

… a shadowed list)

- The pending changeset gave one affected range for both defects. The
  prototype pollution through `nest` affects 0.1.0-0.16.3; the filter
  grammar's `Object.prototype` 500 affects only 0.13.0-0.16.3, since
  `src/internal/filter.ts` first shipped in 0.13.0 (f59b77c, #86).
- `nest`'s group literal no longer carries a `Record<string, unknown>`
  annotation, a `no-unsafe-dictionary-type` site the effect `Record`
  import hid from the linter; the cast after `getOrElse` already types
  the group, so the rule's true count is back to its pre-#264 base.
- `Query.filter.test.ts` drops a nested `inherited` list that shadowed
  the identical module-level one.

No behaviour change.

Refs #260.

Claude-Session: https://claude.ai/code/session_0187g2QpzaHqEzX8GJxiJBVc
Co-Authored-By: Claude <noreply@anthropic.com>
The pending changeset's headline named two defects, but the change also
fixes a third request-triggerable 500: `nest`'s `??= {}` group write
throws a TypeError when a bracket key follows a bare key of the same
name (strict-mode assignment onto a string), the #260 title bug. It hits
the same no-family endpoints over the same range. Checked against the
published 0.1.0 and 0.16.3 packages: `Query.schema(R, {})` throws
`TypeError: Cannot create property ... on string` for that input on
both.

The headline now names three defects: the prototype pollution and that
500 on no-family endpoints (0.1.0-0.16.3), and the filter grammar's 500
(0.13.0-0.16.3). Still no request payload and no fixed version.

Refs #260.

Claude-Session: https://claude.ai/code/session_0187g2QpzaHqEzX8GJxiJBVc
Co-Authored-By: Claude <noreply@anthropic.com>
@thomasfosterau
thomasfosterau merged commit c40ffd2 into trunk Oct 8, 2026
1 check passed
@thomasfosterau
thomasfosterau deleted the issue-260-security-followup branch October 8, 2026 07:40
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