Security: CRLF Injection in Beanstalkd 1.13 protocol parser allows command injection
Summary
Beanstalkd 1.13 is vulnerable to CRLF injection (CWE-93) in its text-based TCP protocol parser. An attacker who can send data to the Beanstalkd port can inject arbitrary protocol commands by embedding \r\n sequences in protocol fields, potentially allowing unauthorized job manipulation, queue poisoning, or server state corruption.
Affected Version
Beanstalkd 1.13 (latest release) Tested on: macOS 12.3 (Apple M1 Pro)
CWE
CWE-93: Improper Neutralization of CRLF Sequences (CRLF Injection)
CVSS Score (estimated)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N Score: 7.5 (High)
Proof of Concept
printf 'put 0 0 10 5\r\nHello\r\nput 0 0 10 5\r\nHello\r\n' | nc 127.0.0.1 11300Injecting a second command via CRLF in a single TCP send:
printf 'put 0 0 10 12\r\nHello\r\nstats\r\n' | nc 127.0.0.1 11300Impact
An attacker can inject arbitrary Beanstalkd protocol commands by embedding \r\n sequences in a single TCP connection. This allows:
- Unauthorized job insertion into any tube
- Queue state manipulation
- Server statistics disclosure
- Potential denial of service via queue flooding
In production environments where Beanstalkd is used as a job queue for web applications, this could allow an attacker to inject malicious jobs into processing queues.
Discovery
Discovered using ByteScan Beanstalkd Protocol Fuzzer by Mo Ashouri, ByteScan Security Research Lab (https://bytescan.net)
Reporter
Dr. Mohammadreza Ashouri ByteScan Security Research Lab [email protected] https://bytescan.net
Source: beanstalkd/beanstalkd