Skip to content

fix(security): address review on elicitation credential flow - #362

Merged
gaurav-singh-9227 merged 1 commit into
browserstack:mainfrom
SavioBS629:fix/elicitation-review
Aug 6, 2026
Merged

fix(security): address review on elicitation credential flow#362
gaurav-singh-9227 merged 1 commit into
browserstack:mainfrom
SavioBS629:fix/elicitation-review

Conversation

@SavioBS629

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #361 (credential elicitation for createAccessibilityAuthConfig and createLCASteps), addressing review findings on the elicitation flow.

Changes

  • Instrumentation gapcreateAccessibilityAuthConfig now fires trackMCP on the missing-credentials return path (previously untracked when the user declines or the client can't elicit), and the handler is wrapped in try/catch so a getClientCapabilities() failure routes through handleMCPError instead of throwing raw.
  • Silent failure in createLCASteps — when requires_authentication is set but no credentials could be obtained (client can't elicit or the user declines), the tool now returns a clear error instead of silently creating a login test case with credentials: undefined. This mirrors the accessibility tool's behavior.
  • Log-leak hardening — the elicitation fallback no longer logs the raw error (a client validation error can echo the submitted password); it logs a static warn instead.
  • Types — the elicitation result is typed as ElicitResult.
  • Context budget — trimmed the new .describe() strings back within the tool-prompt budget.

Testing

  • npm run build (lint + format + tests + tsc) — green (273 tests).
  • Updated the createLCASteps test that had codified the silent behavior to assert the new error, and added a backward-compat test (credentials passed as args with requires_authentication set).

🤖 Generated with Claude Code

- createAccessibilityAuthConfig: fire trackMCP on the missing-credentials
  path and wrap the handler in try/catch so getClientCapabilities() failures
  route through handleMCPError instead of throwing raw.
- createLCASteps: when requires_authentication is set but no credentials could
  be obtained (client can't elicit or the user declined), return a clear error
  instead of silently creating a login test case with no credentials — mirrors
  the accessibility tool.
- elicit-credentials: do not log the raw elicitation error (a client validation
  error can echo the submitted password); log a static warning instead, and
  type the result as ElicitResult.
- Trim the new .describe() strings back within the context-window budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gaurav-singh-9227
gaurav-singh-9227 merged commit c3fac57 into browserstack:main Aug 6, 2026
1 check 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.

2 participants