[PATCH] mod_http: Catch errors when parsing IP from X-Forwarded-For
8 views
Skip to first unread message
Boris Grozev
unread,
Oct 27, 2023, 12:57:48 PM10/27/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to proso...@googlegroups.com
Hello,
A small fix to prevent throwing an exception when the X-Forwarded-For
header includes invalid values. Repro with just
curl $BOSH_URL -X POST -H "X-Forwarded-For: something-invalid"
Oct 27 16:55:32 http.server error Traceback[httpserver]:
/usr/share/lua/5.2/prosody/util/ip.lua:233: attempt to index local
'ipA' (a nil value)
stack traceback:
/usr/share/lua/5.2/prosody/util/ip.lua:233: in function 'match_ip'
/usr/lib/prosody/modules/mod_http.lua:297: in function 'is_trusted_proxy'
/usr/lib/prosody/modules/mod_http.lua:319: in function
'get_forwarded_connection_info'
/usr/lib/prosody/modules/mod_http.lua:334: in function
</usr/lib/prosody/modules/mod_http.lua:330>