meta_ads_mcp/core/http_auth_integration.py v1.0.108, line 268. The AuthInjectionMiddleware.dispatch() method extracts an Authorization Bearer header (with X-META-ACCESS-TOKEN and X-PIPEBOARD-API-TOKEN as alternates) into one local, and X-Pipeboard-Token into a second local. When both come back None, the function enters an if branch whose body is exactly one statement: logger.warning("HTTP Auth Middleware: No authentication tokens found in headers"). The line after the closing brace is try: response = await call_next(request). The MCP tool handler at the other end of that call reads META_ACCESS_TOKEN from the operator's environment, appends it to Graph as access_token=<long-lived> in the query string, and on every 4xx serializes e.request.url verbatim into the JSON-RPC error payload's full_response.request_url field. CVE-2026-48039 is what happens when a security middleware's deny branch logs the absence and falls through to the same call_next the accept branches use. Pipeboard shipped the fix in v1.0.109, and re-shipped it as v1.0.114 because the v1.0.109 conditional admitted X-Pipeboard-Token: anything.
CVE-2026-48039: meta-ads-mcp Logged "No Authentication Tokens Found In Headers." The Next Line Called call_next.
vendor
patterns
cve
proof of concept
The warning log was the entire enforcement
Read meta_ads_mcp/core/http_auth_integration.py at the 1.0.108 commit, starting at line 249:
class AuthInjectionMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
logger.debug(f"HTTP Auth Middleware: Processing request to {request.url.path}")
logger.debug(f"HTTP Auth Middleware: Request headers: {list(request.headers.keys())}")
auth_token = FastMCPAuthIntegration.extract_token_from_headers(dict(request.headers))
pipeboard_token = FastMCPAuthIntegration.extract_pipeboard_token_from_headers(dict(request.headers))
if auth_token:
FastMCPAuthIntegration.set_auth_token(auth_token)
if pipeboard_token:
FastMCPAuthIntegration.set_pipeboard_token(pipeboard_token)
if not auth_token and not pipeboard_token:
logger.warning("HTTP Auth Middleware: No authentication tokens found in headers")
try:
response = await call_next(request)
return responseThree conditionals. The first two set request-scoped tokens onto the FastMCP integration's thread-local. The third tests for the absence of both. The body of the third conditional is one statement, a WARN-level log line whose message contains the exact words No authentication tokens found in headers. The line after the conditional's closing brace is try:. The line after that is await call_next(request).
call_next is Starlette's hand-off to the next middleware in the stack, which on this server is the FastMCP request handler that dispatches MCP tool calls. The handler is reached unconditionally. A request with Authorization: Bearer <token> reaches it with auth_token set on the thread-local. A request with no auth header reaches it with auth_token left at None. From dispatch()'s perspective, the two cases differ in one log line.
The 1.0.109 patch is fourteen new lines, all of them inside the same conditional:
if not auth_token and not pipeboard_token:
- logger.warning("HTTP Auth Middleware: No authentication tokens found in headers")
+ logger.warning(
+ "HTTP Auth Middleware: rejecting request to %s, no Authorization "
+ "Bearer or X-PIPEBOARD-API-TOKEN header present", request.url.path,
+ )
+ return Response(
+ content=json.dumps({
+ "error": "Unauthorized",
+ "message": ("Authentication required. Provide an Authorization: "
+ "Bearer <token> header (Meta access token) or an "
+ "X-PIPEBOARD-API-TOKEN header. See "
+ "STREAMABLE_HTTP_SETUP.md."),
+ }),
+ status_code=401,
+ media_type="application/json",
+ headers={"WWW-Authenticate": "Bearer"},
+ )The conditional did not move. The two variables it tests did not move. The patch is the verb in the new warning, rejecting in place of Not found, and the return Response(...) on the next line. The branch the patch needed to enforce was the branch the source already wrote. The warning was the gate.
This is the fail-open-intercept pattern in the Python conditional dialect. Same shape as Tomcat's EncryptInterceptor, where catch (GeneralSecurityException) { log.warn(...); } is followed by super.messageReceived(msg) outside the try. Same shape as DataEase's CommunityTokenFilter, where the catch writes a 401 body and the next line calls filterChain.doFilter() regardless. Same shape as Xerte's connector.php, where the auth check emits header('Location: ...') and PHP execution falls through to the upload dispatcher because header() does not terminate. The gate ran. The gate identified the failure. The gate narrated the failure into a logging channel. The gate proceeded to the action it was supposed to refuse.
META_ACCESS_TOKEN is the implicit operator credential, by precedence
Read meta_ads_mcp/core/auth.py:443:
async def get_current_access_token() -> Optional[str]:
"""Get the current access token from auth manager"""
# Check for environment variable first - this takes highest precedence
env_token = os.environ.get("META_ACCESS_TOKEN")
if env_token:
logger.debug("Using access token from META_ACCESS_TOKEN environment variable")
if len(env_token) < 20:
logger.error("TOKEN VALIDATION FAILED...")
return None
return env_token
# ... fall through to per-request thread-local, then to OAuth manager ...The comment is in the source. META_ACCESS_TOKEN is checked first. Its presence short-circuits every other token source the project supports, including the per-request thread-local that AuthInjectionMiddleware was supposed to populate. The handler the unauthenticated call_next reaches calls get_current_access_token() to pick a credential, and the first line of that function returns the operator's environment variable.
This is the intended behavior for stdio mode. The MCP project's primary transport is JSON-over-stdin/stdout, invoked by a local IDE or agent runtime as a child process. In stdio mode, the operator is the caller; trust is bounded by the OS process boundary. META_ACCESS_TOKEN is documented as the convenient credential for that case: set it once in your shell rc, every tool call in your session uses it. This is the internal-only-by-convention shape, an env-var whose design context is local IPC, promoted to security-relevant authority on every inbound HTTP request the moment the transport flag flips.
--transport streamable-http is the second mode. The same Python process now binds a Starlette ASGI server to a port. The same get_current_access_token() runs on the request thread. The same env-var precedence applies. The middleware sitting between the network and the tool handler was the only layer that distinguished "operator at the local console" from "stranger on the network." That layer was the one that logged the absence and forwarded the request.
The error URL handed back the credential
Even if a network-reachable caller could only invoke tools as the operator, the bug would be critical: full Meta Ads API authority over the operator's accounts. Read insights, mutate campaigns, spend budget, exfiltrate the audience graph. The reason the CVSS is 9.1 and not 9.0 is the second half of the chain. The unauthenticated caller does not have to keep using the tool. They can extract the long-lived operator credential and use it directly against Graph from anywhere.
Read meta_ads_mcp/core/api.py at v1.0.108, starting around line 132:
request_params = params or {}
request_params["access_token"] = access_token
# ...
response = await client.get(url, params=encoded_params, headers=headers, timeout=30.0)The Graph API token travels as a query-string parameter. This is Meta's documented contract: GET /v24.0/me/adaccounts?access_token=<token>&fields=.... The token is in the URL. httpx records the URL on the request object as the canonical record of what it sent.
Now read make_api_request()'s httpx.HTTPStatusError handler at line 285:
full_response = {
"headers": dict(e.response.headers),
"status_code": e.response.status_code,
"url": str(e.response.url),
"reason": getattr(e.response, "reason_phrase", "Unknown reason"),
"request_method": e.request.method,
"request_url": str(e.request.url)
}
return {
"error": {
"message": f"HTTP Error: {e.response.status_code}",
"details": error_info,
"full_response": full_response
}
}e.request.url is the full outbound URL, query string included. str() on an httpx.URL returns the URL verbatim. The dictionary is the body of the JSON-RPC error response the MCP caller receives. Any tool invocation that produces a Graph 4xx, a wrong account ID, an invalid campaign ID, an expired token, any of the dozens of error codes the Graph API emits, returns a payload whose error.details.full_response.request_url field contains access_token=<the-operator-s-long-lived-token>.
The 1.0.109 patch adds one helper:
_SENSITIVE_QUERY_PARAMS = frozenset({"access_token", "appsecret_proof"})
def _redact_url(url: str) -> str:
"""Strip sensitive query params (access_token, appsecret_proof) from a URL."""
if not url:
return url
try:
parts = urlsplit(url)
if not parts.query:
return url
scrubbed = [
(k, "REDACTED" if k in _SENSITIVE_QUERY_PARAMS else v)
for k, v in parse_qsl(parts.query, keep_blank_values=True)
]
return urlunsplit((parts.scheme, parts.netloc, parts.path,
urlencode(scrubbed), parts.fragment))
except Exception:
return url.split("?", 1)[0]And calls it twice in full_response:
- "url": str(e.response.url),
+ "url": _redact_url(str(e.response.url)),
"reason": ...,
"request_method": e.request.method,
- "request_url": str(e.request.url)
+ "request_url": _redact_url(str(e.request.url))The fix is two function calls and one frozenset. The redaction was straightforward. What it tells you is that the project shipped a Graph API client across one hundred and eight minor releases where the error payload carried request_url verbatim, and the only mitigation against access_token ending up in that field was the operator never receiving a 4xx. The mitigation was the success path.
The 1.0.109 patch and the 1.0.114 patch are the same patch, written twice
The 1.0.109 diff puts a return Response(401) inside if not auth_token and not pipeboard_token. Read FastMCPAuthIntegration.extract_pipeboard_token_from_headers at line 98:
@staticmethod
def extract_pipeboard_token_from_headers(headers: dict) -> Optional[str]:
# Check for Pipeboard token in X-Pipeboard-Token header (duplication API pattern)
pipeboard_token = headers.get('X-Pipeboard-Token') or headers.get('x-pipeboard-token')
if pipeboard_token:
logger.debug("Found Pipeboard token in X-Pipeboard-Token header")
return pipeboard_token
# Check for legacy Pipeboard token header
legacy_token = headers.get('X-PIPEBOARD-API-TOKEN') or headers.get('x-pipeboard-api-token')
if legacy_token:
return legacy_token
return NoneX-Pipeboard-Token is a supplementary service header. It exists for the duplication callback, an internal flow where Pipeboard's hosted service makes a downstream call to itself with a non-authenticating routing tag. The header was never a credential. The function's docstring says so. The comment above the first lookup says duplication API pattern. The extractor returns the first non-empty value it finds, and the 1.0.109 deny conditional reads the return value as a single boolean.
A request with X-Pipeboard-Token: x and no other auth header passes the v1.0.109 gate. pipeboard_token is "x", truthy, the not pipeboard_token clause is false, the whole and is false, the deny branch is skipped. Tool handlers downstream see no auth_token set, fall back to META_ACCESS_TOKEN exactly as in v1.0.108, and the chain runs.
This is GHSA-2v2f-mvfg-ph56, filed in the same SECURITY.md as the 9gw6 entry that names CVE-2026-48039. It does not have a CVE assigned at the time of writing. The fix landed five minor releases later, as 1.0.114:
- if not auth_token and not pipeboard_token:
+ if not auth_token:
+ # A request must carry a primary access-token credential.
+ # X-Pipeboard-Token is only a supplementary service token for the
+ # duplication callback, on its own it establishes no request auth
+ # context, so it must not admit a request.
logger.warning(...)
return Response(..., status_code=401, ...)The 1.0.114 patch removes and not pipeboard_token from the deny conditional. The conditional the 1.0.108 source had narrated the absence of, the 1.0.109 patch had wired to a 401, and the 1.0.114 patch had to narrow because the 1.0.109 wiring admitted a header whose own extractor describes it as a supplementary service token.
Pipeboard is now three security advisories deep on --transport streamable-http in seven minor releases: the original middleware fail-open (9gw6, CVE-2026-48039), the middleware-fix bypass (2v2f, unnumbered), and an SSRF in upload_ad_image (45gf, unnumbered) in 1.0.115. All three rely on the same operational shape, a Python process designed for stdio mode rebound to a TCP port with the operator's long-lived credential in the environment. The hosted Pipeboard MCP at *.mcp.pipeboard.co is not affected by any of the three, because it binds to localhost behind an authenticating proxy and does not set META_ACCESS_TOKEN. The advisories are precisely about the self-hosted operator who followed STREAMABLE_HTTP_SETUP.md.
This is the design-debt-driver shape. The component is the same component across the three advisories. The substrate is the same: stdio-mode credential plumbing reused on a network transport. Each patch closes the specific instance. The next one is one new feature, or one new header, away.
The conditional was right at 1.0.108
The pre-patch source did not lack a check. The check was the conditional. The body was the warning. The 1.0.109 patch reads what was already there, recognizes that the test reaches when the result should be a refusal, and writes the refusal. The 1.0.114 patch reads what 1.0.109 wrote, recognizes that one of the two variables it tests is a duplication-callback routing tag, and removes it from the predicate.
v1.0.108 wrote the right conditional and the wrong body. v1.0.109 wrote the right body for the wrong conditional. v1.0.114 finally wrote both.
PoC: pipeboard-co/meta-ads-mcp (vendor advisory; no separate public PoC repository; the chain is fully derivable from the 14d7371 fix commit on the upstream repository).
The 1.0.109 patch is what you write when you finally read the conditional you already had.