createUser/updateUser store passwords that fail SASLprep, leaving a credential no client can use · Issue #765 · documentdb/documentdb · GitHub
Skip to content

createUser/updateUser store passwords that fail SASLprep, leaving a credential no client can use #765

Open

Description

@guanzhousongmicrosoft

Problem

createUser and updateUser accept passwords that fail SASLprep (RFC 4013) and store a credential no standard client can use. PrehashPassword in pg_documentdb/src/commands/users.c runs pg_saslprep and, when it returns SASLPREP_PROHIBITED or SASLPREP_INVALID_UTF8, quietly builds the SCRAM secret from the raw bytes. Clients run SASLprep before SCRAM and refuse such passwords, so the call reports success and every login fails, for example ValueError: SASLprep: failed prohibited character check for a password containing an emoji.

Fix

Raise a bad-value error in PrehashPassword when SASLprep fails, rather than falling back. This covers every caller: wire-protocol createUser/updateUser, the container and the native installer. Passwords SASLprep accepts, including non-ASCII ones like pässword, keep working.

Why it matters for packaging

The packaging tools can't carry SASLprep's Unicode tables, so #731 refuses every non-ASCII password before setup as a stopgap. Once the backend rejects exactly the failing passwords, the tools can drop that rule and keep only the line-ending and control-character checks.

Acceptance criteria

Activity

  1. documentdb-triage-tool commented on Oct 5, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: write-operations, bug, performance
    Project fields suggested: Component commands · Priority P1 · Effort M · Status In Progress
    Confidence: 0.85 (llm)

    Reasoning

    LLM: Silent SASLprep fallback stores an unusable credential, causing every subsequent login to fail — an active blocker for affected users, fixed in a single command-layer file with a clear remediation path.

    If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions