Hacking Discussion Why FreeShop is still possible on the Switch, and what should have been done to prevent it.

SimonMKWii

Professional Idiot
OP
Member
Joined
Nov 18, 2017
Messages
666
Trophies
0
Location
Melbourne, Victoria
XP
2,760
Country
Australia
Here's my (moderately detailed) analysis on why freeShop is still possible on Switch, and what I believe Nintendo should have done differently to prevent certain things.

First, lets recall how freeshop works on 3DS (heavily simplified):
Get the titlekey from a database
Generate the ticket for that title
Install the ticket
Get title contents from CDN
Install title contents
The title is now playable.

And this is how the Switch fails to prevent it (also heavily simplified):

Get the titlekey from a database:
That can't be stopped.

Generate the ticket for that title:
They would have solved that by generating RSA-wrapped personalized tickets server-side, but this is easily defeated by disabling signature checks and generating an unsigned common ticket.

Install the ticket:
With patched sysmodules, there's nothing stopping an attacker sending the ipc commands necessary for installing a common ticket.

Get title contents from CDN:
Nintendo really fucked this one up hard.

All requests to atum (within your certs environment) are accepted.

This is extremely poor design as both system modules/applets and eShop content share the Atum server.

What they should have done is segregate system and eShop content to different servers.

System content should require just your console-unique cert, similar to the current system put in place.

In the case of eShop content, it should require your ShopN bearer auth token, and check that your account has the rights to the requested title prior to returning any of its content (NCAs and patch CETKs).

Yes, Atum doesn't check whether you own a certain title before returning its content.

The dumbest part is, it was always possible, as Shogun, the eShop backend, already has a feature to list all of your owned titles that aren't currently installed on your device.

Sending an authed GET request to https://bugyo.hac.lp1.eshop.nintend...ned_titles?shop_id=4&lang=en&device_type_id=6 returns a JSON with all of the uninstalled titles you own.

And yet another colossal fuckup is sending an authed POST request to the "redownload" endpoint https://bugyo.hac.lp1.eshop.nintend...d_titles/download?device_type_id=6&title_ids= (title ID, uppercase) with the data "lang=en" will invoke nsBeginInstallApplication; downloading and installing the title, regardless of whether or not the requested title ID is present in your owned titles.

Yes, "owned_titles/download", unlike what the name would imply, doesn't actually check whether you're trying to download an owned title, and just downloads every title ID sent to the endpoint regardless.

Install title contents:
Same issue as ticket installation.

Assuming sigpatches are enabled and the ticket is installed, the Switch can load the titlekey from the ticket into the relevant keyslot, and the title is now playable.
 

syntaxyz

Well-Known Member
Newcomer
Joined
Dec 2, 2014
Messages
50
Trophies
0
Age
33
XP
1,184
Country
Netherlands
Nice analysis, thank you.
Tho I must say that nothing about this is unfixable, but I don't think N is going to have any of this fixed. I don't know what company created the eshop backend, but if its the same one as the 3ds one we are sure they arent going to give a flying f... sadly...
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,852
Country
United States
They could fix it, but seeing as Nintendo tries to make sure everyone's device is updated, they won't do it, as again, system apps and eShop apps share the same server.
It's not impossible to selectively allow certain titles, like system + anything your account owns. We already know that they know who exactly is downloading what exactly from their network.
 
  • Like
Reactions: jakibaki

SimonMKWii

Professional Idiot
OP
Member
Joined
Nov 18, 2017
Messages
666
Trophies
0
Location
Melbourne, Victoria
XP
2,760
Country
Australia
It's not impossible to selectively allow certain titles, like system + anything your account owns. We already know that they know who exactly is downloading what exactly from their network.
That's true, but will they implement selective downloading?
As @syntaxyz quite rightly said, Nintendo have a history of not patching server exploits.
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,827
Trophies
1
Age
44
XP
6,606
Country
Germany
And yet another colossal fuckup is sending an authed POST request to the "redownload" endpoint https://bugyo.hac.lp1.eshop.nintend...d_titles/download?device_type_id=6&title_ids= (title ID, uppercase) with the data "lang=en" will invoke nsBeginInstallApplication; downloading and installing the title, regardless of whether or not the requested title ID is present in your owned titles.

Yes, "owned_titles/download", unlike what the name would imply, doesn't actually check whether you're trying to download an owned title, and just downloads every title ID sent to the endpoint regardless.
This is just one little thing to fix in their backend. If I was working at Nintendo this would take me around 10 minutes to do.
Thanks for pointing Nintendo to it lol.
 

Bedel

The key of the blade
Member
Joined
Oct 28, 2015
Messages
1,384
Trophies
0
XP
2,849
Country
United States
This is just one little thing to fix in their backend. If I was working at Nintendo this would take me around 10 minutes to do.
Thanks for pointing Nintendo to it lol.
Yeah I thought the same. It's something preatty easy to fix, so I don't get how they messed this up (again)... But maybe in the next eshop mantenance we'll see it fixed.
 
  • Like
Reactions: lordelan

SimonMKWii

Professional Idiot
OP
Member
Joined
Nov 18, 2017
Messages
666
Trophies
0
Location
Melbourne, Victoria
XP
2,760
Country
Australia
Yeah I thought the same. It's something preatty easy to fix, so I don't get how they messed this up (again)... But maybe in the next eshop mantenance we'll see it fixed.
Yeah, once the next eShop maintenance takes place, I'll test downloading Mario Kart 8 Deluxe and cancel the download straight after (I own the cartridge version, so I don't feel too bad about using it as the test title).
Ok but if you play with a pirated installed nsp game online, ban
Yes, that's something Nintendo did extremely well, I'm very impressed with the Aauth implementation.
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,915
Trophies
2
XP
29,776
Country
United Kingdom
Sounds too easy to fix, but we're lucky so far.

What I want to know is how hard it would be to send an alternate console certificate (rather than the one built in to your console). People have been using already-banned certificates that have been shared online when downloading from computers, but if downloading directly on the Switch, would system patches let you swap in the chosen certificate into the existing process? Would you have to rewrite the whole download process down to the level of http protocol exchanges?
 

Nincompoopdo

Well-Known Member
Member
Joined
May 20, 2017
Messages
600
Trophies
0
XP
2,705
Country
United States
Currently all NSP installed under SX OS works flawlessly. If TX built a CDN downloader into the CFW and auto installed the downloaded nsp (they are working on a installer) it should be similar to Freeshop.
 
  • Like
Reactions: Ty_

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
  • BakerMan @ BakerMan:
    fellas
  • BakerMan @ BakerMan:
    would you rather have a 9-5 desk job with poor pay or work for an intergalactic space militia with no guarantee of being paid?
  • BakerMan @ BakerMan:
    basically, normal boring job or halo and/or helldivers irl
    BakerMan @ BakerMan: basically, normal boring job or halo and/or helldivers irl