Skip to main content

CVE-2021-43799: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in zulip zulip

Medium
Published: Tue Jan 25 2022 (01/25/2022, 20:55:11 UTC)
Source: CVE
Vendor/Project: zulip
Product: zulip

Description

Zulip is an open-source team collaboration tool. Zulip Server installs RabbitMQ for internal message passing. In versions of Zulip Server prior to 4.9, the initial installation (until first reboot, or restart of RabbitMQ) does not successfully limit the default ports which RabbitMQ opens; this includes port 25672, the RabbitMQ distribution port, which is used as a management port. RabbitMQ's default "cookie" which protects this port is generated using a weak PRNG, which limits the entropy of the password to at most 36 bits; in practicality, the seed for the randomizer is biased, resulting in approximately 20 bits of entropy. If other firewalls (at the OS or network level) do not protect port 25672, a remote attacker can brute-force the 20 bits of entropy in the "cookie" and leverage it for arbitrary execution of code as the rabbitmq user. They can also read all data which is sent through RabbitMQ, which includes all message traffic sent by users. Version 4.9 contains a patch for this vulnerability. As a workaround, ensure that firewalls prevent access to ports 5672 and 25672 from outside the Zulip server.

AI-Powered Analysis

AILast updated: 06/23/2025, 19:33:35 UTC

Technical Analysis

CVE-2021-43799 is a vulnerability affecting Zulip Server versions prior to 4.9, an open-source team collaboration platform. The issue arises from the way Zulip Server installs and configures RabbitMQ, which it uses for internal message passing. During the initial installation phase, until the first reboot or restart of RabbitMQ, the server does not properly restrict access to certain default ports, notably port 25672. This port is used by RabbitMQ as a distribution and management port, protected by a "cookie" authentication mechanism. However, the cookie is generated using a cryptographically weak pseudo-random number generator (PRNG), specifically one with limited entropy. Although the theoretical entropy limit is 36 bits, practical biases in the seed reduce this to approximately 20 bits of entropy. This low entropy makes it feasible for a remote attacker to brute-force the cookie value if network or OS-level firewalls do not block access to port 25672. Successful brute-forcing allows the attacker to execute arbitrary code with the privileges of the rabbitmq user and to intercept or read all message traffic passing through RabbitMQ, compromising confidentiality and integrity of communications. The vulnerability is mitigated in Zulip Server version 4.9 by patching the PRNG usage and improving port access restrictions. As a workaround, administrators are advised to enforce firewall rules that block external access to ports 5672 and 25672 until the server is fully configured and restarted. No known exploits have been reported in the wild to date.

Potential Impact

For European organizations using vulnerable versions of Zulip Server, this vulnerability poses a significant risk to the confidentiality and integrity of internal communications. Since RabbitMQ handles all message passing, an attacker who exploits this flaw can eavesdrop on sensitive conversations, potentially exposing proprietary information, personal data, or strategic communications. The ability to execute arbitrary code as the rabbitmq user could also lead to further lateral movement within the network, privilege escalation, or disruption of services. This is particularly critical for organizations in sectors such as finance, healthcare, government, and critical infrastructure, where secure communication is paramount. The initial installation phase represents a window of exposure, but if network segmentation and firewall policies are not properly enforced, the risk extends beyond this period. Given the collaborative nature of Zulip, the impact could affect multiple departments or teams simultaneously, amplifying potential damage.

Mitigation Recommendations

1. Upgrade to Zulip Server version 4.9 or later, which includes patches addressing the weak PRNG and port access issues. 2. Until upgrading, immediately implement strict firewall rules to block inbound traffic to RabbitMQ ports 25672 and 5672 from any untrusted networks, including the internet and less secure internal segments. 3. During initial installation and configuration, ensure that RabbitMQ is restarted promptly to enforce port restrictions. 4. Monitor network traffic for unusual connection attempts to RabbitMQ ports, especially during installation or maintenance windows. 5. Employ network segmentation to isolate Zulip servers from general user networks and restrict access to only trusted administrative hosts. 6. Regularly audit and review firewall and host-based firewall configurations to confirm that no unintended access is permitted to RabbitMQ management ports. 7. Consider deploying intrusion detection or prevention systems (IDS/IPS) with signatures tuned to detect brute-force attempts against RabbitMQ authentication mechanisms. 8. Educate system administrators about the vulnerability window during installation and the importance of immediate firewall enforcement and service restarts.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2021-11-16T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9841c4522896dcbf20ef

Added to database: 5/21/2025, 9:09:21 AM

Last enriched: 6/23/2025, 7:33:35 PM

Last updated: 7/31/2025, 3:45:39 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats