CVE-2023-45145: Redis Unix-domain socket may have be exposed with the wrong permissions for a short time window.
CVE-2023-45145 - The wrong order of listen(2) and chmod(2) calls creates a race condition that can be used by another process to bypass desired Unix socket permissions on startup.
Upstream have released version 7.0.14/7.2.2 to fix CVE-2023-45145.
Reference: - https://github.com/redis/redis/releases/tag/7.0.14 - https://bugs.mageia.org/32406
Other sources
Redis could allow a local authenticated attacker to bypass security restrictions, caused by a race condition when a permissive umask(2) is used during startup. By sending a specially crafted request, an attacker could exploit this vulnerability to establish an unauthorized connection.
— IBM
Redis is an in-memory database that persists on disk. On startup, Redis begins listening on a Unix socket before adjusting its permissions to the user-provided configuration. If a permissive umask(2) is used, this creates a race condition that enables, during a short period of time, another process to establish an otherwise unauthorized connection. This problem has existed since Redis 2.6.0-RC1. This issue has been addressed in Redis versions 7.2.2, 7.0.14 and 6.2.14. Users are advised to upgrade. For users unable to upgrade, it is possible to work around the problem by disabling Unix sockets, starting Redis with a restrictive umask, or storing the Unix socket file in a protected directory.
— Ubuntu
Redis Unix-domain socket may have be exposed with the wrong permissions for a short time window.
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/redisto a version that resolves this vulnerability.Fixed in 5:5.0.14-1+deb10u5Fixed in 5:7.0.15-1~deb12u1Fixed in 5:7.0.15-1 - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 5:4.0.9-1ubuntu0.2+ - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 5:5.0.7-2ubuntu0.1+ - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 5:6.0.16-1ubuntu1+ - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 2:2.8.4-2ubuntu0.2+ - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 7.2.2 - Upgrade
Upgrade
ubuntu/redisto a version that resolves this vulnerability.Fixed in 2:3.0.6-1ubuntu0.4+ - Upgrade
Upgrade
redhat/redisto a version that resolves this vulnerability.Fixed in 7.2.2 - Upgrade
Upgrade
redhat/redisto a version that resolves this vulnerability.Fixed in 7.0.14 - Upgrade
Upgrade
redhat/redisto a version that resolves this vulnerability.Fixed in 6.2.14 - Upgrade
Upgrade
redisto a version that resolves this vulnerability.Fixed in 7.2.2 - Upgrade
Upgrade
redisto a version that resolves this vulnerability.Fixed in 7.0.14 - Upgrade
Upgrade
redisto a version that resolves this vulnerability.Fixed in 6.2.14 - Compensating control
If you cannot upgrade, work around CVE-2023-45145 by disabling Unix sockets in Redis (disable Unix-domain socket support).
- Compensating control
If you cannot upgrade, start Redis with a restrictive umask during startup to avoid permissive umask race conditions that can expose the Unix socket with wrong permissions.
- Compensating control
If you cannot upgrade, store the Redis Unix socket file in a protected directory to prevent other processes from creating an unauthorized connection during the startup window.
Event History
Frequently Asked Questions
What is CVE-2023-45145?
CVE-2023-45145 is a vulnerability in Redis where the Unix-domain socket may be exposed with the wrong permissions for a short time window.
What is Redis?
Redis is an in-memory database that persists on disk.
How does CVE-2023-45145 affect Redis?
CVE-2023-45145 affects Redis versions between 2.6.0 and 6.2.14, 7.0.0 and 7.0.14, and 7.2.0 and 7.2.2.
What is the severity of CVE-2023-45145?
The severity of CVE-2023-45145 is low, with a CVSS score of 3.6.
How can I fix CVE-2023-45145?
To fix CVE-2023-45145, upgrade Redis to a version that is not affected by the vulnerability.