Problem/Motivation
Language negotiation allows to link a language to a separate domain.
A non-trusted user with the 'administer languages' permission, could be using this as a way to create a phishing attack.
Proposed resolution
Mark the "administer languages" permission as restricted, so people managing permissions can understand this is a permission that shouldn't be given to untrusted roles.
Remaining tasks
None.
User interface changes
In the permissions page, "administer languages" will show a warning.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Original report
This was originally reported by @mlhess: https://security.drupal.org/node/155183 . This does not pose serious threats e.g. making redirection to external domains possible and was considered appropriate to be handled publicly.
---
(Original report:)
1. give user A permission 'administer language'
2. as user A go to /admin/config/regional/language and enable a second language
3. go to admin/config/regional/language/configure and enable the URL detection method
3. go to /admin/config/regional/language/detection/url and set "Part of the URL that determines language" to "Domain"
4. Go back to admin/config/regional/language, edit the language you enabled above, and enter a domain of your choice in the "'Language domain" field.
5. Eventually (depends on caching) users will end up at your domain. (For example, if you enable the Language Switcher block provided by Drupal core, the link for the above language will point to the above external domain.)
This works. It does not require a trusted permission, but "Administer language" Should be is my guess.
---
(@David_Rothstein's comment)
So there are a couple different ways you can fake a user browsing site A into visiting evil site B:
1. "Malicious redirect" - a link points to a URL at site A, but when you go to that URL you are redirected to site B.
2. "Malicious link" - a link on site A points to site B directly, but the wording/placement of the link on the site strongly suggests it's an official link that will keep you on site A.
I guess you can make an argument that #1 is worse than #2 (though for the average web user I'm not sure it matters). But there's no way we can consider #2 a vulnerability, at least in the case where the attacker's permissions on the site already allow them to modify the site's "official" content... We'd have to mark half the permissions in Drupal as "restrict access" :)
The issue summary here is a bit vague about which this is, but in my testing (I only tested with Drupal 7) I could only produce #2 ("malicious link") with this issue, never an actual redirect. Can anyone else confirm that?
---
| Comment | File | Size | Author |
|---|---|---|---|
| 155183-D8.patch | 342 bytes | dokumori |
Issue fork drupal-3076793
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3076793-language-administer-warning
changes, plain diff MR !11824
Comments
Comment #2
JvE commentedThe basic attack scenario I envisioned was:
1. As user with administer language permission uses the domain trick to send all language X traffic to a similar domain, running a proxy to the original language domain.
2. Alert the administrator that language X doesn't work on the site.
3. Administrator goes to the site, switches to language X, sees that indeed the language doesn't switch.
4. Admin logs in (the switch logged him/her out if they were already logged in) to investigate/fix it and their credentials are captured by the proxy.
5. Proxy triggers script that restores the original functionality and redirects admin to original site.
Contrived? Unrealistic? Far-fetched? Yeah, probably.
Dangerous? To inattentive admins in a hurry perhaps.
Comment #11
smustgrave commentedWonder if still an issue on D11 after 6 years?
Comment #12
penyaskitoThis is still needs a proper resolution.
a) Add a new restricted permission for
language.negotiation_urlroute, flagged with "restrict access".b) Flag "administer languages" as "restrict access".
c) Change nothing, but document this in language.permissions.yml?
d) Do nothing.
I tempt to think that c is the right one.
Comment #13
gábor hojtsyI think this makes the most sense.
Comment #15
penyaskitoEasy enough to fix in the browser and test on tugboat :-)
Comment #16
smustgrave commentedCan we update the issue summary still though please
Thanks!
Comment #17
penyaskitoComment #18
smustgrave commentedThanks. Rest seems good
Comment #19
quietone commentedUnfortunately, this is a long title that does not describe the change. See List of issue fields.
Comment #20
gregglesMaybe like this?
Comment #21
quietone commentedMuch better, thanks. Restoring the RTBC.
Comment #24
catchCommitted/pushed to 11.x and cherry-picked to 10.5.x, thanks!