Skip to content

documentdb-local: operator password is readable in the process list for the container's lifetime #685

Done

Description

@guanzhousongmicrosoft

Summary

The operator password passed to documentdb-local with --password stays
readable in the process list for the entire lifetime of the container.

Details

emulator_entrypoint.sh runs as PID 1 and never re-execs, so the argv it was
started with — including the --password <value> pair — remains in
/proc/1/cmdline until the container stops. Every log-streaming subshell the
entrypoint forks inherits the same argv, so the value shows up several times
over.

Reproduction

docker run -d --name pwtest documentdb-local:latest \
    --username testuser --password 'SuperSecret123'

# The password is visible to anything that can read the process list:
docker exec pwtest ps -ef | grep -c SuperSecret123
docker exec pwtest cat /proc/1/cmdline | tr '\0' ' '

Both commands echo the password back. Anyone who can docker exec into the
container, or read the host process list for the container's processes, can
recover it without touching a log file or a config file.

Expected

The password should not be recoverable from the process list. Passing it via
the environment keeps it readable only by the container's own uid, which is
the same protection the PASSWORD environment variable already gets.

Notes

--password is the documented way to set the operator password, so this is
not avoidable by users who follow the quickstart.

Activity

  1. added
    emulator
    on Jul 27, 2026
  2. documentdb-triage-tool commented on Jul 27, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: emulator, bug
    Project fields suggested: Component documentdb-local · Priority P1 · Effort S · Status In Progress
    Confidence: 0.85 (llm)

    Reasoning

    LLM: Security vulnerability: the operator password is exposed in the process list for the entire container lifetime, making it trivially recoverable by anyone with exec access — this is a credential leak in the documented setup 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.

  3. documentdb-triage-tool commented on Aug 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  4. documentdb-triage-tool commented on Aug 26, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  5. documentdb-triage-tool commented on Sep 9, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  6. documentdb-triage-tool commented on Sep 23, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  7. added this to the 1.0-RC2 milestone on Oct 5, 2026
  8. guanzhousongmicrosoft commented on Oct 5, 2026

    @guanzhousongmicrosoft
    MemberAuthor

    Still open on main. Plan for 1.0-RC2: after parsing its arguments, the entrypoint re-execs itself with the values passed through the environment, so PID 1's argv no longer holds the password. A test will assert that no /proc/*/cmdline contains it. The RC2 branch already keeps the password out of the start_oss_server.sh arguments and out of the logs.

  9. added
    1.0-blocker
    on Oct 6, 2026
  10. guanzhousongmicrosoft commented on Oct 6, 2026

    @guanzhousongmicrosoft
    MemberAuthor

    1.0 blocker. The fix (the entrypoint re-execs without its arguments, so PID 1's argv holds no password) is in review.

  11. documentdb-triage-tool commented on Oct 28, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 22 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  12. documentdb-triage-tool commented on Nov 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  13. guanzhousongmicrosoft commented on Nov 23, 2026

    @guanzhousongmicrosoft
    MemberAuthor

    Fixed on main (cf53d26): the entrypoint re-executes itself without arguments once they're parsed, so --password no longer appears in any process's command line. The image tests check every /proc/*/cmdline. Closing.

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

Metadata

Metadata

Labels

1.0-blockerbugdocumentdb-1.0emulator

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions