Skip to content

fix: match WWW-Authenticate params exactly#3016

Open
mturac wants to merge 1 commit into
modelcontextprotocol:mainfrom
mturac:izon/fix-www-auth-param-boundary
Open

fix: match WWW-Authenticate params exactly#3016
mturac wants to merge 1 commit into
modelcontextprotocol:mainfrom
mturac:izon/fix-www-auth-param-boundary

Conversation

@mturac

@mturac mturac commented Jun 28, 2026

Copy link
Copy Markdown

Summary

  • parse WWW-Authenticate auth-params outside quoted values before extracting a field
  • require auth-param names to match exactly
  • cover substring collisions and quoted-value false positives

Fixes #3009

Tests

  • uv run --frozen pytest tests/client/test_auth.py -k 'extract_field_from_www_auth'
  • uv run --frozen pytest tests/client/test_auth.py
  • uv run --frozen ruff format --check src/mcp/client/auth/utils.py tests/client/test_auth.py
  • uv run --frozen ruff check src/mcp/client/auth/utils.py tests/client/test_auth.py
  • git diff --check
  • uv run --frozen coverage run -m pytest tests/client/test_auth.py -k 'extract_field_from_www_auth' && uv run --frozen coverage combine && uv run --frozen strict-no-cover

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/mcp/client/auth/utils.py Outdated
@mturac mturac force-pushed the izon/fix-www-auth-param-boundary branch from 0159fe2 to da31061 Compare June 28, 2026 21:54
@mturac

mturac commented Jun 28, 2026

Copy link
Copy Markdown
Author

Addressed in da31061 by parsing auth-params with quote-aware comma splitting and adding regression coverage for quoted-value false positives.

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.

WWW-Authenticate parsing matches a field name as a substring of another auth-param

1 participant