GHSA-q344-5v34-gm84: @sylphx/pdf-reader-mcp: HTTP transport accepts unauthenticated requests despite a configured MCP_API_KEY

Published Oct 29, 2026
·
Updated

Impact

When @sylphx/pdf-reader-mcp is run as an HTTP server (MCPTRANSPORT=http), it reads the MCPAPIKEY environment variable and logs API key authentication enabled (X-API-Key header) at startup, but it never validated the X-API-Key header on incoming requests. The key was read into a variable and never enforced on the request path.

As a result, the /mcp endpoint accepted unauthenticated requests. Combined with the default bind address of 0.0.0.0 (all interfaces), any client able to reach the port could invoke every PDF tool and read the contents of any PDF the server process could open anywhere on the host. URL-based sources also enable limited SSRF (private/loopback addresses are blocked by default unless --allow-private-ips is set).

The misleading startup log made the exposure silent: an operator who set MCPAPIKEY reasonably believed the server was protected when it was not.

This affects only the opt-in HTTP transport; the default stdio transport is unaffected.

Patches

Fixed in @sylphx/pdf-reader-mcp@3.0.1. The fix enforces the X-API-Key header with a constant-time comparison (rejecting missing/mismatched keys with HTTP 401), changes the default bind host to 127.0.0.1 (loopback), and emits a startup warning when binding a non-loopback host without an API key.

Workarounds

For deployments that cannot upgrade immediately:

- Bind to loopback only: MCPHTTPHOST=127.0.0.1. - Place a reverse proxy in front that enforces authentication. - Use the default stdio transport instead of HTTP. - Restrict filesystem reach with --allow-dir / MCPPDFALLOWEDDIRS.

Reported privately by novice-22 via responsible disclosure.

Affected Software

1 affected componentFixes available
npm/@sylphx/pdf-reader-mcp>=2.2.0<3.0.1
3.0.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@sylphx/pdf-reader-mcp to a version that resolves this vulnerability.

    Fixed in 3.0.1
  2. Upgrade

    Upgrade @sylphx/pdf-reader-mcp to a version that resolves this vulnerability.

    Fixed in 3.0.1
  3. Configuration

    Bind the HTTP server to loopback only by setting MCP_HTTP_HOST=127.0.0.1.

    @sylphx/pdf-reader-mcp HTTP transport MCP_HTTP_HOST = 127.0.0.1
  4. Configuration

    Restrict filesystem access using --allow-dir or MCP_PDF_ALLOWED_DIRS.

    @sylphx/pdf-reader-mcp --allow-dir / MCP_PDF_ALLOWED_DIRS = restricted filesystem paths
  5. Configuration

    Use the default stdio transport instead of HTTP.

    @sylphx/pdf-reader-mcp MCP_TRANSPORT = stdio
  6. Compensating control

    Place a reverse proxy in front of the HTTP endpoint and enforce authentication there.

Event History

Oct 29, 2026
Advisory Published
via GitHub·04:34 PM
Data Sourced
via GitHub·04:34 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Only deployments using the opt-in HTTP transport (MCP_TRANSPORT=http) are affected. The default stdio transport is unaffected.

2

Who can exploit an affected server?

Any client that can reach the server's port can invoke the /mcp endpoint without providing an API key. This is especially significant because the default bind address is 0.0.0.0, which exposes the service on all interfaces.

3

What can an unauthenticated caller access?

An unauthenticated caller can invoke every PDF tool and read contents of any PDF that the server process can open anywhere on the host. URL-based sources also allow limited SSRF; private and loopback addresses remain blocked by default unless --allow-private-ips is configured.

4

Does the startup message indicating API-key authentication is enabled mean the endpoint is protected?

No. Affected versions read MCP_API_KEY and log that API-key authentication is enabled, but did not validate the X-API-Key header on requests.

5

What version fixes the issue?

The issue is fixed in @sylphx/pdf-reader-mcp version 3.0.1, which enforces the X-API-Key header and rejects missing or mismatched keys with HTTP 401.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203