# GHSA-6CJ5-68CM-V828: SSRF via non-enforcing private-IP check in link-shortener validate endpoint

- Database: GitHub
- Severity: CVSS 5.3 (Medium)
- Published: 2026-08-17
- Modified: 2026-08-17

## Affected versions

- @profullstack/mcp-server (npm): through 1.4.12

## Description

## Summary
The `link-shortener` module of `@profullstack/mcp-server` has an explicit private-IP/loopback detection control in `validateUrl`, but the control is broken: on a private-IP match it only calls `console.warn` and never throws, so control falls through and the URL is accepted. An unauthenticated attacker can therefore drive a server-side `fetch(url,{method:'HEAD'})` to arbitrary internal hosts, obtaining a blind port/reachability/redirect oracle (SSRF).

## Root Cause
`validateUrl` (`utils.js:12-66`) builds `privatePatterns` for localhost/127./192.168./10./172.16-31/::1/fe80: (`utils.js:43-51`) with the comment "Check for localhost/private IPs in production" — but the match handler is `if (isPrivate) { console.warn(...) }` (`utils.js:53-56`) with no `throw`/`return false`; control falls through to `return true` (`utils.js:65`). Notably, the same function DOES throw for `file:`/`ftp:`/`javascript:` schemes (`utils.js:59-63`), proving the author intended to reject dangerous inputs and simply failed to enforce the private-IP block — a genuine broken security control, not works-as-designed.

## Impact
Blind SSRF via HEAD requests: an unauthenticated attacker learns internal host reachability, open ports, and redirect targets (`status`, `statusText`, `redirected`, `finalUrl`). HEAD-only with no body reflection bounds the impact to a reachability/redirect oracle.

## Proof of Concept
```
POST /link-shortener/validate
Content-Type: application/json

{"url":"http://internal-host/","checkAccess":true}
```

## Attack Chain
1. **Entry:** `POST /link-shortener/validate` (`index.js:32` -> `controller.js:168`) with an internal-host `url` and `checkAccess:true`. **Guard:** none (no auth). **Bypass proof:** `src/core/middleware.js` has no authentication layer.
2. **Check:** `validateUrl(url)` (`utils.js:12-66`). **Guard:** private-IP patterns exist (`utils.js:43-51`). **Bypass proof:** a match only triggers `console.warn(...)` (`utils.js:55`) with NO `throw`/`return`; control falls through to `return true` (`utils.js:65`).
3. **Sink:** `if (checkAccess) linkService.validateUrlAccess(url)` (`controller.js:193`) -> `fetch(url,{method:'HEAD'})` (`service.js:166`). **Guard:** none blocking. **Bypass proof:** reached only after the non-blocking warn.
4. **Impact:** `{status,statusText,redirected,finalUrl}` returned (`service.js:174-182`) — internal reachability + redirect oracle.

## Bypass Evidence
`utils.js:53-56`: `const isPrivate = ...; if (isPrivate) { console.warn(...) }` with no `throw`; control reaches `return true` at `utils.js:65`. The scheme block at `utils.js:59-63` DOES throw, demonstrating the private-IP path is a broken (non-enforcing) control.

## Affected Versions
`<= 1.4.12` (code present on HEAD; package.json = 1.4.12, no tags beyond).

## Suggested Fix
Make the private-IP detection enforcing: `throw` (or `return false`) when `isPrivate` is true, mirroring the existing scheme rejection. Resolve DNS and re-check the resolved address to prevent DNS-rebinding, and reject redirects to private ranges in `validateUrlAccess`.

---
Reported by **zx (Jace)** — GitHub: @manus-use

## References

- https://github.com/profullstack/mcp-server/security/advisories/GHSA-6cj5-68cm-v828

Page: https://cve.now/GHSA-6CJ5-68CM-V828

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
