fix: secure DingTalk QR setup access#24716
Closed
plgonzalezrx8 wants to merge 2 commits into
Closed
Conversation
…vulnerability-2026-05-13 fix: secure DingTalk QR setup access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
DINGTALK_ALLOW_ALL_USERS=trueunconditionally, which could unintentionally open the bot to all DingTalk users. The change prevents that unsafe default and ensures operators are prompted to choose access controls.Description
DINGTALK_ALLOW_ALL_USERS=truewrite with a post-credential access-control prompt implemented in a new_configure_dingtalk_access()helper that supports explicit allowlist entry, DM pairing, or explicit open-access opt-in.DINGTALK_ALLOWED_USERSas anis_allowlistplatform variable so manual setup also surfaces the allowlist prompt.DINGTALK_ALLOWED_USERSandDINGTALK_ALLOW_ALL_USERSto the known_EXTRA_ENV_KEYSso managed env handling recognizes them.tests/hermes_cli/test_dingtalk_setup.py) that assert the QR-flow no longer writesDINGTALK_ALLOW_ALL_USERS=truesilently and that access-control prompting is present.Testing
pytest tests/hermes_cli/test_dingtalk_setup.py -q -o addopts="-m 'not integration'"and they passed (2 passed).python -m py_compile hermes_cli/gateway.py hermes_cli/config.py, which succeeded.save_env_value("DINGTALK_ALLOW_ALL_USERS", "true")remains in the_setup_dingtalk()flow, which passed.Codex Task
Summary by CodeRabbit
New Features
Documentation