Project

General

Profile

Actions

Bug #2766

closed

crashes for invalid IP addresses when using mod_extforward

Added by Gilby about 8 years ago. Updated about 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_extforward
Target version:
ASK QUESTIONS IN Forums:

Description

lighttpd crashes when using mod_extforward from an invalid IP.

These two cases have shown in my error.log:
2016-11-01 08:13:01: (mod_extforward.c.330) could not parse ip address 78.253.43.53:50883 because hostname nor servname provided, or not known (Bad file descriptor)
2016-01-14 11:58:53: (mod_extforward.c.331) could not parse ip address 147.13.742.564 because hostname nor servname provided, or not known (Bad file descriptor)

And this shows in my /var/log/messages:
Nov 1 08:13:01 x kernel: pid 31758 (lighttpd), uid 80: exited on signal 11

Actions #1

Updated by gstrauss about 8 years ago

Please try this patch:

--- a/src/mod_extforward.c
+++ b/src/mod_extforward.c
@@ -423,6 +423,7 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) {

        if (real_remote_addr != NULL) { /* parsed */
                sock_addr sock;
+               sock.plain.sa_family = AF_UNSPEC;
                data_string *forwarded_proto = (data_string *)array_get_element(con->request.headers, "X-Forwarded-Proto");

                if (NULL != forwarded_proto) {

Actions #2

Updated by Gilby about 8 years ago

Thanks, I applied that patch a few days ago and so far no issues.

Actions #3

Updated by gstrauss about 8 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom