security(whatsapp): deny unknown senders when WHATSAPP_ALLOWED_USERS is empty (#8389)#8410
Closed
draix wants to merge 1 commit into
Closed
security(whatsapp): deny unknown senders when WHATSAPP_ALLOWED_USERS is empty (#8389)#8410draix wants to merge 1 commit into
draix wants to merge 1 commit into
Conversation
19 tasks
23 tasks
Collaborator
Contributor
Author
|
Cerrando este PR como superseded por #21291 (mergeado el 2026-05-07), que también cierra #8389 e implementa el mismo fix sobre Notas para futuro tracking:
Sin acción pendiente — cierro y limpio el branch. |
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.
Summary
matchesAllowedUser()inscripts/whatsapp-bridge/allowlist.jsreturnedtruewhen the allowlist was empty, allowing any sender to trigger the agent in bot mode. This is a medium-high severity issue: anyone who messages the bot owner's WhatsApp number could interact with their Hermes agent.Root cause
Fix
Impact on self-chat mode
None. In self-chat mode the bridge already filters to
fromMe=truemessages before callingmatchesAllowedUser. Third-party senders never reach the allowlist check in self-chat, so this change does not affect the default configuration.What you need to do
If you are running in bot mode (
WHATSAPP_MODE=bot) withoutWHATSAPP_ALLOWED_USERSset, you now need to configure who can use the bot:A clear warning is now logged at startup when bot mode is active and no allowlist is configured.
Additional improvements
gateway/run.py: extra warning when WhatsApp is in bot mode with no allowlist configuredTesting
14 new tests in
tests/test_whatsapp_allowlist_security.pycovering:TestEmptyAllowlistDenies)TestAllowlistMatchesCorrectly,TestAllowlistNormalization)TestSelfChatModeIsUnaffected)Fixes #8389