Guile security vulnerability with listening on localhost and port
Guile's REPL listener bound to localhost was vulnerable to DNS rebinding combined with an HTML form protocol attack, allowing a malicious website to send Scheme code to the local port and execute it. The fix detects incoming HTTP connections and closes them before executing any code.
lists.gnu.org
Published on lists.gnu.org
http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=08c021916dbd3a235a9f9cc33df4c418c0724e03
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application assumed that a service listening on localhost is only reachable by local users, but browsers can be tricked into sending requests to localhost via DNS rebinding and form submission.
Impact
An attacker could execute arbitrary Scheme code on a developer's machine, potentially compromising the system.
What the attacker needed
Guile REPL listening on localhost; Victim visits a malicious website; Browser allows cross-origin requests to localhost
The fix
The vulnerability was fixed by detecting incoming HTTP connections and closing them before executing any code; a safer long-term solution is to use Unix domain sockets instead of localhost plus a port.
How it was found
- Visit a malicious website that loads JavaScript or tricks the user into pressing a button.
- The site operator switches the DNS from their own IP to 127.0.0.1.
- A POST request is sent from the website to [redacted] with the body containing Scheme code.
- The Guile interpreter on the listening port executes the code.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Guile is a programming language, and it has a feature that lets developers connect to a running program to change it live. This feature listened on a local address that was thought to be safe because only the same computer could reach it. But a malicious website can trick the browser into sending requests to that local address, and the program would run the code it received.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.