1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
guile/module
Mark H Weaver 08c021916d REPL Server: Guard against HTTP inter-protocol exploitation attacks.
Reported by Christopher Allan Webber <cwebber@dustycloud.org>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>

This commit adds protection to Guile's REPL servers against HTTP
inter-protocol exploitation attacks, a scenario whereby an attacker can,
via an HTML page, cause a web browser to send data to TCP servers
listening on a loopback interface or private network.  See
<https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and
<https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol
Attack (2001) by Tochen Topf <jochen@remote.org>.

Here we add a procedure to 'before-read-hook' that looks for a possible
HTTP request-line in the first line of input from the client socket.  If
present, the socket is drained and closed, and a loud warning is written
to stderr (POSIX file descriptor 2).

* module/system/repl/server.scm: Add 'maybe-check-for-http-request'
to 'before-read-hook' when this module is loaded.
(with-temporary-port-encoding, with-saved-port-line+column)
(drain-input-and-close, permissive-http-request-line?)
(check-for-http-request, guard-against-http-request)
(maybe-check-for-http-request): New procedures.
(serve-client): Use 'guard-against-http-request'.
* module/system/repl/coop-server.scm (start-repl-client): Use
'guard-against-http-request'.
* doc/ref/guile-invoke.texi (Command-line Options): In the description
of the --listen option, make the security warning more prominent.
Mention the new protection added here.  Recommend using UNIX domain
sockets for REPL servers.  "a path to" => "the file name of".
2016-10-11 11:29:09 +02:00
..
ice-9 Fix error when boot-9.go after "skip invalid .go files" commit 2016-07-14 16:20:59 +02:00
language Fix bug compiling fixpoint combinator 2016-07-16 12:05:21 +02:00
oop Accessor methods only apply to subclasses with their slot 2015-01-26 17:57:44 +01:00
rnrs Fix (rnrs io simple) to open file ports in textual mode. 2014-03-19 23:36:46 -04:00
scripts guild disassemble: Use #:prefix instead of #:renamer. 2014-09-20 05:47:05 -04:00
srfi Don't recurse in drop-right 2016-07-12 15:53:40 +02:00
sxml Remove duplicate definitions of call/ec' and let/ec'. 2013-04-06 15:40:19 +02:00
system REPL Server: Guard against HTTP inter-protocol exploitation attacks. 2016-10-11 11:29:09 +02:00
texinfo texinfo: Remove unnecessary (oop goops) dependency. 2016-08-04 19:15:09 +02:00
web http: Do not use 'eq?' to compare characters in parse-request-uri. 2016-09-09 07:32:53 -04:00
Makefile.am Add meta/build-env 2016-07-10 13:21:38 +02:00
rnrs.scm Add missing R6RS `open-file-input/output-port' procedure 2012-11-12 20:47:57 +01:00
statprof.scm statprof: 'statprof' and 'with-statprof' return the code's return values. 2015-01-11 20:44:44 +01:00
texinfo.scm Fix newline preservation in @example with lines beginning with @ 2014-03-17 21:49:16 +01:00