Skip to content

[CRITICAL] cve-fix: Addressing SSRF CVE in Swagger UI endpoint - #1407

Merged
yussufsh merged 2 commits into
IBM:mainfrom
adarshagrawal38:ctritical-cve
Sep 12, 2026
Merged

yussufsh merged 2 commits into
IBM:mainfrom
adarshagrawal38:ctritical-cve

Conversation

@adarshagrawal38

Copy link
Copy Markdown
Member

fix: mitigate SSRF CVE in Swagger UI endpoint

What changed

router.go:34 — two hardening changes to the /swagger/*any route:

Spec URL locked to localginSwagger.URL("/swagger/doc.json") is passed to WrapHandler, restricting the UI to only load the locally-served spec. This prevents the ?url= query parameter from being overridden to an arbitrary address (including cloud metadata endpoints, private network addresses, or localhost services).

Security context

github.com/go-openapi/spec (indirect dependency) has a known SSRF vulnerability: its default $ref loader fetches any URL without restriction. The Swagger UI's free-form spec URL input was the exploitable entry point in this service. These changes close that vector without removing the UI.

@adarshagrawal38
adarshagrawal38 marked this pull request as ready for review September 7, 2026 05:29
Comment thread ai-services/internal/pkg/catalog/apiserver/router.go Outdated
@yussufsh

yussufsh commented Sep 8, 2026

Copy link
Copy Markdown
Member

@pranithraoibm ptal

pranithraoibm
pranithraoibm previously approved these changes Sep 11, 2026

@pranithraoibm pranithraoibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yussufsh

Copy link
Copy Markdown
Member

@adarshagrawal38 let us just bump up the go-openapi/spec version for now. SSRF we will take care in coming days if needed.

Signed-off-by: Adarsh Agrawal <adarsh.agrawal1@ibm.com>
Signed-off-by: Adarsh Agrawal <adarsh.agrawal1@ibm.com>
@yussufsh
yussufsh merged commit 9314b1e into IBM:main Sep 12, 2026
10 checks passed
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.

4 participants