Skip to content

Add failing tests for microCMS content-id path traversal - #43

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/content-id-traversal-tests-5b8b
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/content-id-traversal-tests-5b8b

Conversation

@cursor

@cursor cursor Bot commented Nov 20, 2026

Copy link
Copy Markdown

These tests fail on purpose until content ids and endpoints are constrained to a single path segment before the module calls microCMS. No production code is changed here.

A server-rendered page that passes a route value into useMicroCMSGetListDetail, useMicroCMSGetList, or useMicroCMSGetObject currently lets that value change the API-key GET. The suite builds a fixture app, serves it, and records the outbound request. Fourteen cases return another content API's JSON in the page. Six cases already pass: ordinary ids, a path-segment question mark that the router strips before the helper, and a catch-all dot segment that Nuxt 404s before the helper runs.

Run:

node --test --test-concurrency=1 --test-timeout=180000 test/content-id-traversal.test.mjs

The command needs the repo dependencies installed (npm ci). It prepares the playground types, builds test/fixtures/ssr-app, and expects the hostile cases to make no microCMS request and to omit the other API's body.

Open in Web Open in Cursor 

Server-rendered pages that pass a route value to the fetch helpers
let a visitor retarget the API-key request. These tests expect that
request to be refused, so they fail until the path is constrained.
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.

1 participant