Skip to content

Add failing tests for absolute endpoint URL credential leak - #10

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/endpoint-url-ssrf-tests-c324
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/endpoint-url-ssrf-tests-c324

Conversation

@cursor

@cursor cursor Bot commented Nov 20, 2026

Copy link
Copy Markdown

Summary

These tests are expected to fail until the endpoint handling bug is fixed. They do not change production code.

Microcms\Client::list, get, create, update, and delete pass the caller-supplied endpoint string through to Guzzle as the request URI and always attach the X-MICROCMS-API-KEY header. An absolute URL (https://… or http://…) or a protocol-relative URL (//…) replaces the https://{serviceDomain}.microcms.io/api/v1/ base, including when a content id is joined onto that endpoint. The tests require each of those calls to throw InvalidArgumentException before the HTTP client is invoked.

Joining a content id onto a normal endpoint name stays on the service host, so that input is not part of this suite.

How to run

composer install --prefer-dist --no-progress
vendor/bin/phpunit tests/EndpointUrlSecurityTest.php

On the current code this reports 48 failures. vendor/bin/phpunit tests/ClientTest.php still passes.

Open in Web Open in Cursor 

list, get, create, update, and delete currently forward an absolute or
protocol-relative endpoint to the HTTP client with the API key header.
These tests require that input to be rejected before any request is sent.
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