Bug 51801 - simplesamlphp: disable error reporting form
simplesamlphp: disable error reporting form
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: SAML
UCS 4.4
Other All
: P5 normal (vote)
: UCS 4.4-5-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-10 17:22 CEST by Moritz Bunkus
Modified: 2020-08-26 16:35 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Security Issue
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Security
Max CVSS v3 score: 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L)


Attachments
patch (git:fbest/51801-saml-configurable-error-reporting) (2.59 KB, patch)
2020-08-11 09:57 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Bunkus 2020-08-10 17:22:12 CEST
Created attachment 10453 [details]
example spam mail body

The current SimpleSAMLPHP configuration shows an error reporting form if an error occurs. The user can enter details, and an email is dispatched to "root". This is a bad idea: we just had one customer where an automated bot tried thousands of exploits by POSTing data like "'); drop table …" to those form fields. They, in turn, generated an email per POST. And as we receive mail to "root" in real mailboxes, that mailbox was spammed with ~2.000 mails in 15 minutes before I had a chance to stop Postfix.

Apart from it being an unnecessary source for potential spam I also don't consider that form to be really useful for regular people. Most wouldn't know what do enter as a useful description, even technically knowledgeable people would most likely fail to produce good bug reports solely via that form.

Fortunately turning off said error reporting form is easy: just add "'errorreporting' => false," to "/etc/simplesamlphp/config.php" (or rather, the template it is generated from).

Please consider turning the form off unconditionally, or at least make it configurable via a UCR variable. At the moment we have to keep modified templates around for it.

Thanks.
Comment 1 Florian Best univentionstaff 2020-08-11 08:19:22 CEST
Hi Moritz,

does setting UCRv saml/idp/show-errors=false help as a workaround here?
Comment 2 Florian Best univentionstaff 2020-08-11 08:41:28 CEST
With UCR set saml/idp/technicalcontactemail you can change the email address from root@domainname to something else.
Comment 3 Florian Best univentionstaff 2020-08-11 09:57:18 CEST
Created attachment 10455 [details]
patch (git:fbest/51801-saml-configurable-error-reporting)
Comment 4 Florian Best univentionstaff 2020-08-11 09:58:48 CEST
(In reply to Florian Best from comment #3)
> Created attachment 10455 [details]
> patch (git:fbest/51801-saml-configurable-error-reporting)

Patch contains small typo, use the version from git.
Comment 5 Moritz Bunkus 2020-08-11 10:08:22 CEST
> does setting UCRv saml/idp/show-errors=false help as a workaround here?

No, it doesn't. I tried that before adding "errorreporting" to the config.php without success. The form was still displayed, or rather, POSTs to it were still accepted.

> With UCR set saml/idp/technicalcontactemail you can change the email address from root@domainname to something else.

Yeah, but that isn't a solution, it just redirects the misuse somewhere else. Depending on your system setting this still allows the attacker to fill up your hard drive. It also still clogs up your resources. For our customer Postfix is configured to pass all mails through anti-spam daemons and those hog all CPUs.

Thanks for looking into it & implementing a way to turn it off.
Comment 6 Florian Best univentionstaff 2020-08-19 21:04:03 CEST
Added the UCR variable saml/idp/show-error-reporting to disable the PHP form which sends emails.
Additionally some robustness fixes has been done to evaluation of some UCR variables.

univention-saml (6.0.2-48)
48f9021754dc | Bug #51801: make saml/idp/ldap/get_attributes and saml/idp/ldap/search_attributes safe for UCRs bogus tab completion
eb8faf1452ba | Bug #51801: make UCR variables boolean
42d7697c096c | Bug #51801: make error reporting configurable

univention-saml.yaml
b1523b7019a2 | YAML Bug #51801
Comment 7 Moritz Bunkus 2020-08-20 08:55:54 CEST
Much appreciated! Thanks.
Comment 8 Florian Best univentionstaff 2020-08-21 09:07:45 CEST
sorry, I commited some typos. They have been fixed in:

univention-saml (6.0.2-50)
f2925448b121 | Bug #51801: add missing bracket
c2a94c347a70 | Bug #51801: add missing bracket
Comment 9 Johannes Keiser univentionstaff 2020-08-26 11:08:47 CEST
OK: The button to send error reports is diabled if saml/idp/show-errors=false is set
OK: post request are ignored if saml/idp/show-errors=false is set
OK: yaml
-> verified