Project

General

Profile

Actions

Bug #3064

closed

Server Aborted due to Malicious Data sent to lighty.stat

Added by axe34 over 4 years ago. Updated about 4 years ago.

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

Description

My configuration file is as follows.

server.modules += ("mod_magnet","mod_accesslog")
server.port = 3000
server.document-root = "/var/www/" 
etag.use-inode = "disable" 
etag.use-mtime = "disable" 
etag.use-size = "disable" 
static-file.etags = "disable" 
mimetype.assign = (
  ".html" => "text/html", 
)
magnet.attract-physical-path-to = ( "/home/***/magnet.lua"  )

Here is my lua script.

print(lighty.env["uri.query"])
lighty.stat(lighty.env["uri.query"])

My script basically takes input from the uri.query and passes it to lighty.stat.

If the parameter is empty, it will cause the server to abort.
The abort is a security mechanism of lighttpd.

Added by gstrauss over 4 years ago

Revision e56e3871 (diff)

[mod_magnet] reject stat() of empty string (fixes #3064)

(thx axe34)

Anyone running lua code inside the lighttpd server has control over
the lighttpd server, so this commit does not protect against
malicious behavior, but instead this commit more gracefully handles
a lua programmer mistake of attempting to stat() an empty string.

x-ref:
"Server Aborted due to Malicious Data sent to lighty.stat"
https://redmine.lighttpd.net/issues/3064

Actions

Also available in: Atom