From 51b6f3062fde974b862344fd3f8a1b50cc834e91 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 20 Nov 2026 02:25:11 +0000 Subject: [PATCH] fix: reject microCMS endpoints and content ids that are not a single path segment useMicroCMSGetList, useMicroCMSGetListDetail and useMicroCMSGetObject concatenated caller-supplied endpoint and contentId into the request path, so values such as '..\other-api?limit=100' made the server send its API key to a different content API. Validate every segment against the characters microCMS allows and encode it before calling useFetch. --- README.md | 2 ++ src/runtime/composables/useMicroCMSGet.ts | 27 ++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ba6a031..ddbe389 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ type useMicroCMSGetObject = ( // https://nuxt.com/docs/api/composables/use-fetch ``` +`endpoint` and `contentId` must consist only of letters, digits, `-` and `_` (the characters microCMS allows for them). Any other value, such as one containing `/`, `\`, `.` or `?`, throws an error and no request is sent. + ```vue