From: justin@PROTECTED
Hello everyone,
I received a report of a serious security issue with Dada Mail’s Restful Web Services:
https://dadamailproject.com/d/features-restful_web_services.pod.html https://dadamailproject.com/support/documentation-11_22_0/features-restful_web_services.pod.html
Unfortunately I can confirm that this is a valid issue, which affects practically all installations of Dada Mail, no matter if you have this feature enabled or not (it’s disabled by default).
Considering that the web services allow you to create lists, edit settings and even send out messages, this is kind of a big deal. I’ve pasted exactly the report that I received below.
The saving grace of all this is that even though this is a big security hole in Dada Mail, your install probably is not affected, since the web services do usually take an extra step to actually get functioning: that’s enabling the Authorization HTTP header, as mentioned in the docs:
https://dadamailproject.com/d/features-restful_web_services.pod.html#Make-the-Authorization-header-available
Without that header, web services don’t work at all.
So, if you’re using Dada Mail and worrying about this problem, you really need to disable support for the Authorization header in your web server’s configuration. Do not use the RESTful web services.
To be thorough, you can add the following to an .htaccess file in the “dada” directory,
RequestHeader unset Authorization This will also work to remove the Authorization header from incoming requests:
RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:] If you’re worried that your install is vulnerable, email me personally at justin@PROTECTED justin@PROTECTED and I’ll test it myself,
Original report is below: Hello Justin,
I'm kta1kri, an independent security researcher. Following SECURITY.md, I'm reporting an authentication bypass in the Dada Mail REST API (v11.22.0, main a4e7e655), tested only in a local lab.
Root cause: 1. DADA/Config.pm sets $GLOBAL_API_OPTIONS //= { enabled => 0, public_key => undef, private_key => undef }. Because the keys already exist (as undef), the installer's "generate if missing" branches (DadaMailInstaller.pm:1450) never run, and it writes public_key => '' and private_key => '' into .dada_config. 2. DADA/App/WebServices.pm never checks GLOBAL_API_OPTIONS->{enabled}. 3. WebServices.pm:118-124 compares $self->r_public_key eq GLOBAL_API_OPTIONS->{public_key}. A request with no public key (undef) equals '' under eq, so it is promoted to global level with an empty private key; check_public_key() does the same comparison. 4. check_digest() then uses HMAC-SHA256 with that empty key, which anyone can compute. Separately, a list's own key pair is only generated at its first admin login, so lists never logged into also have empty keys.
Local test with the real mail.cgi and SQLite, .dada_config exactly as the installer writes it, and non-empty list keys set on the test list: GET /mail.cgi/api/lablist/settings?nonce=
:abc Authorization: hmac : -> {"status":1, ... "public_api_key":"PUBKEY...", "private_api_key":"PRIVKEY_SECRET_...", "password":" ", ...} update_settings with {"list_name":"PWNED-BY-UNAUTH-API"} -> {"status":1,"results":{"saved":1}} and the row changed in the database. create_new_list, subscription/unsubscription and mass_email take the same path. Impact: on a default v11 install, anyone who knows a list name can read all list settings including its API keys, change settings, add or remove subscribers, create lists and send mass email to every subscriber. CVSS 4.0: AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N (Critical).
Fix: reject API requests unless GLOBAL_API_OPTIONS->{enabled} is true; treat an empty or undef configured key as "no access" (never compare against it); require a non-empty supplied public key; make the installer generate keys when the value is undef or empty, not only when the key is missing.
I can send the lab scripts.
Best regards, kta1kri https://github.com/kta1kri
--
Justin J: Lead Dadaist url: dadamailproject.com email: justin@PROTECTED twitter: @dadamail
Dada Mail Announcements: https://dadamailproject.com/cgi-bin/dada/mail.cgi/list/dada_announce/
- This mailing list is a public mailing list - anyone may join or leave, at any time.
- This mailing list is a group discussion list (unmoderated)
Start a new thread, email: dadadev@dadamailproject.com
This is the developer discussion mailing list for Dada Mail.
If you are just looking for support Dada Mail, consult the message boards at:
https://forum.dadamailproject.com
Documentation for Dada Mail:
Specifically, see the Error FAQ:
https://dadamailproject.com/d/FAQ-errors.pod.html
To post to this list, send a message to:
mailto:dadadev@dadamailproject.com
All subscribers of this list may post to the list itself.
Topics that are welcome:
- Constructive critiques on the program (I like, "x", but, "y" needs some work - here's an idea on how to make this better...)
- Bug/Error reports
- Bug fixes
- Request For Comments on any changes to the program
- Help customizing Dada Mail for your own needs
- Patches
- Language Translations
- Support Documentation/Doc editing, FAQ's, etc.
- Discussion of any changes that you would like to be committed to the next version of Dada Mail -
Dada Mail is on Github:
https://github.com/justingit/dada-mail/
If you would like to fork, branch, send over PRs, open up issues, etc.
Privacy Policy:
This Privacy Policy is for this mailing list, and this mailing list only.
Email addresses collection through this mailing list are used explicitly to work within this email discussion list.
We only collect email addresses through our Closed-Loop Opt-In system.
We don't use your email address for any other purpose.
We won't be sharing your email address with any other entity.
Unsubscription can be done at any time. Please contact us at: justin@dadamailproject.com for any help regarding your subscription, including removal from the mailing list.
All mailing list messages sent from us will include a subscription removal link, which will allow you to remove yourself from this mailing list automatically, and permanently.
All consent to use your email address for any other purpose stated at the time of the mailing list subscription will also be revoked upon mailing list removal.