aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi/admindb.py
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2016-07-14 14:27:49 -0700
committerMark Sapiro <mark@msapiro.net>2016-07-14 14:27:49 -0700
commit6efea059931995de8713f35bccc1116905175cf2 (patch)
tree6f7933394fc09ef5e495b24a558ca9c2a5f983f0 /Mailman/Cgi/admindb.py
parentde6ffbe5a0ce37751247b071b75aa7c8e6605c58 (diff)
downloadmailman2-6efea059931995de8713f35bccc1116905175cf2.tar.gz
mailman2-6efea059931995de8713f35bccc1116905175cf2.tar.xz
mailman2-6efea059931995de8713f35bccc1116905175cf2.zip
Catch TypeError from certain defective crafted POST requests.
Diffstat (limited to '')
-rw-r--r--Mailman/Cgi/admindb.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Mailman/Cgi/admindb.py b/Mailman/Cgi/admindb.py
index fb2c7e18..1e9fad0f 100644
--- a/Mailman/Cgi/admindb.py
+++ b/Mailman/Cgi/admindb.py
@@ -122,6 +122,18 @@ def main():
# Make sure the user is authorized to see this page.
cgidata = cgi.FieldStorage(keep_blank_values=1)
+ try:
+ cgidata.getvalue('adminpw', '')
+ except TypeError:
+ # Someone crafted a POST with a bad Content-Type:.
+ doc = Document()
+ doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
+ doc.AddItem(Header(2, _("Error")))
+ doc.AddItem(Bold(_('Invalid options to CGI script.')))
+ # Send this with a 400 status.
+ print 'Status: 400 Bad Request'
+ print doc.Format()
+ return
if not mlist.WebAuthenticate((mm_cfg.AuthListAdmin,
mm_cfg.AuthListModerator,