Closed Bug 1523319 Opened 7 years ago Closed 7 years ago

[monitor.mozilla.org] - Stale Route53 name server leads to DNS hijacking

Categories

(Websites :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: olivier, Unassigned)

References

()

Details

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

Attachments

(1 file)

Attached image DNS hijacking —

Background

Route53 is a service that allows you to host your DNS (Domain Name System) in the cloud which basically means that it allows you to easily route your traffic.

Nameservers can be configured on each domain level, which means that internal.mozilla.org could have different name servers than mozilla.org.

In this case, monitor.mozilla.org has different name servers than mozilla.org and these are expired (unclaimed in Route53).

Technical details

I was able to take control over the DNS level of monitor.mozilla.org and above.
Because of that I can now create any NS, A, AAAA, CNAME and TXT records for monitor.mozilla.org I want.

I've created a proof of concept on http://poc.monitor.mozilla.org/takeover.html which points to my server. (I can also do this for https://monitor.mozilla.org/)

The impact is that I can:

  • Log all the incoming traffic to (*.)monitor.mozilla.org.
  • Request valid SSL certificates
  • Setup mail server
  • Setup a web server to host malicious content.
  • Read cookies scoped on *.monitor.mozilla.org
  • Create any DNS record I want for (*.)monitor.mozilla.org.

Mitigation

Remove the NS records or create new ones Route53 and configure these. If you have any questions, please let me know.

Kind regards,
Olivier

Flags: sec-bounty?

Thanks for the report Olivier!

Keywords: sec-high, wsec-other
Whiteboard: [reporter-external] [web-bounty-form] [verif?] → [reporter-external] [web-bounty-form]

:bobm or :oremj are the unclaimed R53 nameservers something cloudops controls and should claim or do we need IT/webops?

NI'ing you since you're listed as ops for monitor/blurts.

Flags: needinfo?(oremj)
Flags: needinfo?(bobm)

:bobm on IRC informs me that blurts is on monitor.firefox.com

Flags: needinfo?(oremj)
Flags: needinfo?(bobm)

:rtucker can we nuke monitor.mozilla.org or point it to monitor.firefox.com?

Flags: needinfo?(rtucker)

(In reply to Greg Guthe [:g-k] [:gguthe] from comment #4)

:rtucker can we nuke monitor.mozilla.org or point it to monitor.firefox.com?

I deleted the delegated zones. Below is what the records were for posterity sake.

ns-327.awsdns-40.com

205.251.193.71

ns-1894.awsdns-44.co.uk

205.251.199.102

ns-958.awsdns-55.net

205.251.195.190

ns-1162.awsdns-17.org

205.251.196.138

I've recreated monitor.mozilla.org as a CNAME to monitor.firefox.com

Please give the records a while to propagate and let me know if there's anything else that I can help with.

Flags: needinfo?(rtucker)

(In reply to Rob Tucker [:rtucker] from comment #5)

I deleted the delegated zones. Below is what the records were for posterity sake.

Awesome, thanks :rtucker!

I can confirm the CNAME to monitor.firefox.com and poc.monitor.mozilla.org returning NXDOMAIN:

$ host monitor.mozilla.org
monitor.mozilla.org is an alias for monitor.firefox.com.
monitor.firefox.com has address 35.244.248.27
$ host poc.monitor.mozilla.org
Host poc.monitor.mozilla.org not found: 3(NXDOMAIN)

:bobm :oremj FYI you re: new CNAME pointing to monitor/blurts

Olivier thanks again for the report! Per https://www.mozilla.org/en-US/security/web-bug-bounty/#eligibility this bug eligible for a domain takeover bounty. Our bounty committee will meet in the next couple weeks and get back to you.

Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED

Hi,

Thank you for the quick response and fix! I can verify the fix and it was great to work with you.

Kind regards,
Olivier

Happy to help

Likewise Olivier! Appreciate the detailed report.

:rtucker so my advice to alias the mozilla.org subdomain wasn't a good idea. :jason pointed out that the cert for monitor.firefox.com doesn't include monitor.mozilla.org and fetching https://monitor.mozilla.org/ results in a SSL_ERROR_BAD_CERT_DOMAIN error.

When you get a chance can you nuke the subdomain entry entirely?

No rush, since I don't think anything is using the mozilla.org subdomain and the error is fine for now.

monitor.mozilla.org is no longer a subdomain per the work in comment #5, but is a CNAME. I have deleted it.

(In reply to Rob Tucker [:rtucker] from comment #10)

monitor.mozilla.org is no longer a subdomain per the work in comment #5, but is a CNAME. I have deleted it.

Thanks! Sorry about the extra ping.

lgtm:

$ dig @1.1.1.1 monitor.mozilla.org

; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> @1.1.1.1 monitor.mozilla.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 13792
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;monitor.mozilla.org. IN A

;; AUTHORITY SECTION:
mozilla.org. 3600 IN SOA infoblox1.private.mdc2.mozilla.com. sysadmins.mozilla.org. 2019040337 180 180 1209600 60

;; Query time: 62 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Jan 28 12:53:29 EST 2019
;; MSG SIZE rcvd: 139

No need to apologize at all. Happy to help get this resolved.

Flags: sec-bounty?
Flags: sec-bounty-hof+
Flags: sec-bounty+

Reporter, how would you like to be credited on our hall of fame? If you have somewhere you'd like us to link, we can do that too.

Thanks!

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: