Skip to content

fix: reject prototype paths, fail closed on deny, and run unit tests in CI - #70

Open
martijn00 wants to merge 1 commit into
letstri:mainfrom
martijn00:fix/prototype-safe-check-and-ci
Open

fix: reject prototype paths, fail closed on deny, and run unit tests in CI#70
martijn00 wants to merge 1 commit into
letstri:mainfrom
martijn00:fix/prototype-safe-check-and-ci

Conversation

@martijn00

Copy link
Copy Markdown
Contributor

Summary

  • stacks on #67; review the last commit(s) once perf: enforce bundle budgets and narrow React checks #67 merges
  • reject inherited Object.prototype names and __proto__ hydrate keys so check() cannot authorize via the prototype chain
  • freeze a null-prototype copy of rules on setup() / hydrate() so mutating the caller object or getRules() cannot change authorization
  • fail closed in Fastify and Elysia after deny; forward Express 4 / Node async middleware rejections to next(err)
  • treat empty-subtree ~all as deny, and run pnpm test on every PR

Test plan

  • pnpm exec vitest run src/core src/fastify src/elysia src/express src/node src/extractor
  • pnpm test
  • pnpm run check-types
  • pnpm run lint
  • pnpm run format:check

Checklist

  • added regression tests for inherited names, __proto__ hydrate, empty ~all, reserved extractor segments, no-op onForbidden, and rejecting setup
  • no Permix public API or integration guidance change requiring skill updates

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@martijn00 is attempting to deploy a commit to the letstri Team on Vercel.

A member of the Team first needs to authorize it.

…in CI

check() and ~any/~all only walk own properties, so inherited names such
as `constructor` or `toString` can no longer resolve as rules. hydrate()
skips `__proto__` keys from untrusted JSON. An empty subtree denies
`~all`. Fastify and Elysia respond 403 when a custom onForbidden neither
replies nor returns. Express and Node forward async setup/check errors
to next(err). Add a Test workflow so pnpm test runs on every PR.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@letstri
letstri force-pushed the fix/prototype-safe-check-and-ci branch from b98cd77 to d7c54e8 Compare September 6, 2026 06:50
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