can-i-take-over-xyz icon indicating copy to clipboard operation
can-i-take-over-xyz copied to clipboard

Subdomains pointing to vercel.com are vulnerable

Open ScrubsAndStats opened this issue 4 years ago • 32 comments

Service name

Vercel

Proof

Successful subdomain takeover on a harvard.edu subdomain (screenshot). proof-vercel

Documentation

  • Create a new repository on Github and upload an index.html
  • Visit https://vercel.com/ and sign up using your Github account
  • Create a new project and point it to the previously created Github repository
  • Open the "Domains" tab on Vercel and add the vulnerable domain
  • Boom! Exploited!

ScrubsAndStats avatar Dec 07 '20 06:12 ScrubsAndStats

Can you share the cname regex and the fingerprint?

marcelo321 avatar Dec 17 '20 01:12 marcelo321

Can you share the cname regex and the fingerprint?

Sure

{ "service": "vercel", "cname": [ "" ], "fingerprint": [ "The deployment could not be found on Vercel." ], "nxdomain": false }

ScrubsAndStats avatar Dec 17 '20 18:12 ScrubsAndStats

There are definitely edge cases here.

$ host -t CNAME anythingrandom.console.dev.twilio.com
anythingrandom.console.dev.twilio.com is an alias for cname.vercel-dns.com.
$ curl 'https://anythingrandom.console.dev.twilio.com/'                                                                                                     10:12:48
The deployment could not be found on Vercel.

DEPLOYMENT_NOT_FOUND

image

adityathebe avatar Dec 26 '20 04:12 adityathebe

so the cname we need to grep is vercel-dns.com not vercel.com. thank you @adityathebe

marcelo321 avatar Dec 29 '20 04:12 marcelo321

Can you share the cname regex and the fingerprint?

Sure

{ "service": "vercel", "cname": [ "" ], "fingerprint": [ "The deployment could not be found on Vercel." ], "nxdomain": false }

are you takeover any subdomain? Do you have any poc?

blackcodersec avatar Sep 04 '21 15:09 blackcodersec

Summary for 2021: U can takeover mashed.potato.com only if potato.com is not used in the account of the victim, otherwise, u will get Already owned err.

raladev avatar Sep 24 '21 15:09 raladev

This can be closed as Edge-case

jan-muhammad-zaidi avatar Feb 02 '22 06:02 jan-muhammad-zaidi

It still vulnerable yesterday I takeover 2 subdomains and I've upload my index

M359AH avatar Feb 07 '22 10:02 M359AH

@M359AH u took over mashed.potato.com even when potato.com is already registered? If yes, please share how you managed to do that? Just curious :0

jan-muhammad-zaidi avatar Feb 07 '22 10:02 jan-muhammad-zaidi

@jan-muhammad-zaidi

Hello Muhammed

I've found the subdomain I got this error page

Screen Shot 2022-02-07 at 12 20 49 PM

  • After it, I go to see the CNAME
;; AUTHORITY SECTION:
vercel.app.		60	IN	SOA	ns1.vercel-dns.com. hostmaster.nsone.net. 1644228969 43200 7200 1209600 60

;; Query time: 134 msec
;; SERVER:#53(.131)
;; WHEN: Mon Feb 07 12:41:00 EET 2022
;; MSG SIZE  rcvd: 119

Now I go to vercel.app and add a public repository contains my PoC index and after import the project I've add the domain and added successfully

and my PoC has been uploaded

M359AH avatar Feb 07 '22 10:02 M359AH

How come it's not showing a domain already registered error? Like this image

jan-muhammad-zaidi avatar Feb 07 '22 11:02 jan-muhammad-zaidi

Hello @jan-muhammad-zaidi

I think your target is not vulnerable because It should be registered without an errors like my comment above

M359AH avatar Feb 07 '22 13:02 M359AH

Your index should be uploaded like It:

Screen Shot 2022-02-07 at 3 38 12 PM

Sorry for my bad image edit 😅 😂 😂

M359AH avatar Feb 07 '22 13:02 M359AH

@M359AH no issues with the edit though :P

jan-muhammad-zaidi avatar Feb 08 '22 11:02 jan-muhammad-zaidi

Untitled

Any luck on how to do this?

umar98 avatar May 22 '22 08:05 umar98

Untitled

Any luck on how to do this?

got same error...any clue on this?

Fatmanpoc avatar Jun 20 '22 09:06 Fatmanpoc

Hello Fatma, Umar

Unfortunately, I didn't find this error before

M359AH avatar Jun 20 '22 11:06 M359AH

me aswelll

jareddarkweb avatar Aug 20 '22 17:08 jareddarkweb

https://vercel.com/docs/concepts/projects/custom-domains

Faizee-Asad avatar Sep 19 '22 13:09 Faizee-Asad

Untitled

Any luck on how to do this?

same error , vercel fixed the bug no luck

tw-ddis avatar Oct 20 '22 07:10 tw-ddis

no more takeover

abuvanth avatar Feb 11 '23 05:02 abuvanth

Domain takeovers using Vercel are definitely still possible.

However, they are limited. In my testing, I found that a domain is not vulnerable if:

  • The root domain is used by a Vercel account (i.e. the root domain points to 76.76.21.21 and is linked to a project).
  • The domain/root domain is verified, even if the root domain does not point to 76.76.21.21.
  • Another subdomain of the same root domain is used by a Vercel account.

In practice, this means many subdomains will not be vulnerable (but subdomains definitely can be vulnerable).

There seems to be only one way to be sure a domain is vulnerable or not: try it out.

I created a PR to update the README: #375

joren485 avatar Jun 25 '23 12:06 joren485

image

badhacker0x1 avatar Jul 25 '23 16:07 badhacker0x1

I have the same error but it can be only possible if we configure DNS to that custom domain that should be shown in the Domains category but it's not showing, how could we add DNS?

aravindb26 avatar Aug 02 '23 10:08 aravindb26

Any success on this?

excommunicado110 avatar Sep 04 '23 21:09 excommunicado110

I have the same error but it can be only possible if we configure DNS to that custom domain that should be shown in the Domains category but it's not showing, how could we add DNS?

This has happened to me too, please show me the solution

brijesh1353 avatar Oct 06 '23 19:10 brijesh1353

It's not possible anymore because you have to add a txt record, and that is not possible in the case of subdomain takeover.

image

xElkomy avatar Jan 05 '24 12:01 xElkomy

Yes I think the exploitation now will not complete

M359AH avatar Jan 05 '24 19:01 M359AH

Shouldn't this be marked not vulnerable at this point?

rew1nter avatar Jan 18 '24 12:01 rew1nter