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,182
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,843
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,805
Trophies
1
Age
44
XP
6,577
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,843
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,897
Trophies
2
XP
29,524
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
598
Trophies
0
XP
2,696
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
  • BigOnYa @ BigOnYa:
    Yea here in North Korea, we are only allowed 1 19" tv per household. And the only channel we get is, MLT (Missile Launch Today)
    +1
  • K3Nv2 @ K3Nv2:
    @BigOnYa, doesn't fit in his bedroom he's American
    +1
  • BigOnYa @ BigOnYa:
    I hate ordering stuff online if I can go buy it somewhere close to me, and everywhere anymore will give you a discount only if you order it online, bs. Should be a discount if I go pick it up, not order online.
  • K3Nv2 @ K3Nv2:
    I love it for most things most stores you just shows the receipt online and they scan it
    +1
  • K3Nv2 @ K3Nv2:
    Makes it easy for incompetent restaurant staff that don't know how to hear an order
  • BigOnYa @ BigOnYa:
    Mostly for big purchases, I want it in my hands before I pay. Like a tv, I trust picking it up myself, before I'd trust it being sent thru mail/delivery. (Broken screen, etc) But yea if I can order online, then pickup at store is ok, but not all places offer that.
  • cearp @ cearp:
    > Like a tv, I trust picking it up myself, before I'd trust it being sent thru mail/delivery. (Broken screen, etc)

    Thing is, if you break it driving back to your house, it's your fault. But if the delivery driver damages it, it's not your fault.
    +1
  • K3Nv2 @ K3Nv2:
    Most people that haul big tvs have empty trucks or know enough not to set it face down
  • BigOnYa @ BigOnYa:
    Then I gotta send it back and wait another week or two. I have a pickup truck, with a extended cab, so no prob for me.
  • K3Nv2 @ K3Nv2:
    Most manufacturers pack it well enough where they aren't that dumb to let it happen
  • BigOnYa @ BigOnYa:
    They building a new Microcenter store near by me, is kinda scary. That's my favorite place, I'm like a kid in a candy store there.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, what's a microcenter?
  • K3Nv2 @ K3Nv2:
    Cool I'll make you ship me stuff
    +1
  • K3Nv2 @ K3Nv2:
    Microcenter sells high quality microwaves
  • BigOnYa @ BigOnYa:
    Computer store basically, but they sell everything, like game systems, tvs , 3d printers, etc
    +1
  • K3Nv2 @ K3Nv2:
    I've seen i9/mobo deals for like 400
  • BigOnYa @ BigOnYa:
    Yea been itching to build a new pc, mine is like 3-4 years old, ancient in pc tech time. Still using a sata SSD even.
  • K3Nv2 @ K3Nv2:
    That's still high tech to ancientboi
    +2
  • BigOnYa @ BigOnYa:
    Kinda cool, I can buy a second Xbox for guests, and download all my purchased digital games to it, and play on both xboxs same time. Didn't know they allowed that. 2 xboxs per Xbox account.
  • AncientBoi @ AncientBoi:
    :rofl2: A toaster is "High Tech" to me
    +1
  • K3Nv2 @ K3Nv2:
    No we told you to stop taking baths with them
    +1
  • BigOnYa @ BigOnYa:
    Is crazy to think, you used to be able to build a decent PC for $300-400. Those days are way gone.
  • K3Nv2 @ K3Nv2:
    $600 gets you a decent one
    +1
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, too expensive
    Xdqwerty @ Xdqwerty: @K3Nv2, too expensive