summaryrefslogtreecommitdiffstats
path: root/package/uhttpd/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-08-11 00:05:34 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-08-11 00:05:34 +0000
commit3d99f030820877eb84835fb1be66a7db3f5b0c68 (patch)
treeab165f9195ca06e8c8b635f0edce60ce30c5a706 /package/uhttpd/files
parenta5371dfe3909f14d45803efcfa5a85446f7954ac (diff)
downloadmaster-31e0f0ae-3d99f030820877eb84835fb1be66a7db3f5b0c68.tar.gz
master-31e0f0ae-3d99f030820877eb84835fb1be66a7db3f5b0c68.tar.bz2
master-31e0f0ae-3d99f030820877eb84835fb1be66a7db3f5b0c68.zip
uhttpd: add option to reject requests from RFC1918 IPs to public server IPs (DNS rebinding countermeasure)
SVN-Revision: 22589
Diffstat (limited to 'package/uhttpd/files')
-rw-r--r--package/uhttpd/files/uhttpd.config5
-rwxr-xr-xpackage/uhttpd/files/uhttpd.init1
2 files changed, 6 insertions, 0 deletions
diff --git a/package/uhttpd/files/uhttpd.config b/package/uhttpd/files/uhttpd.config
index acdd62ea4e..534e8f8b29 100644
--- a/package/uhttpd/files/uhttpd.config
+++ b/package/uhttpd/files/uhttpd.config
@@ -12,6 +12,11 @@ config uhttpd main
# Server document root
option home /www
+ # Reject requests from RFC1918 IP addresses
+ # directed to the servers public IP(s).
+ # This is a DNS rebinding countermeasure.
+ option rfc1918_filter 1
+
# Certificate and private key for HTTPS.
# If no listen_https addresses are given,
# the key options are ignored.
diff --git a/package/uhttpd/files/uhttpd.init b/package/uhttpd/files/uhttpd.init
index d543dd84b9..b00b2e281b 100755
--- a/package/uhttpd/files/uhttpd.init
+++ b/package/uhttpd/files/uhttpd.init
@@ -75,6 +75,7 @@ start_instance()
append_bool "$cfg" no_symlinks "-S" 0
append_bool "$cfg" no_dirlists "-D" 0
+ append_bool "$cfg" rfc1918_filter "-R" 0
config_get http "$cfg" listen_http
for listen in $http; do