HexBrain

Nintendo · Report #894922

[3DS][SSL] Improper certificate validation allows an attacker to perform MitM attacks

Validstatus
129upvotes
18 Dec 2020disclosed

Summary

Affected Systems

  • Platform: (New) Nintendo 3DS
  • Region: ALL
  • System version: <= 11.13

Description

The SSL system module does not properly validate the x509 certificates when establishing an SSL/TLS connection. Actually, the SSL system module does not check the signatures when validating a certificate chain, allowing anyone to forge fake certificates and perform MitM attacks or spoof trusted servers.

Vulnerability

The SSL system module uses the RSA BSAFE MES library to implement SSL/TLS communications. This library is very customizable, and a lot of options can be turned on/off at multiple levels. In particular, according to the documentation, the library requires a "resource list" to be provided. The meaning of this list is to describe which aspects of the library will be activated or not.

Again, according to the documentation, the R_VERIFY_RES_SIGNATURE "resource" is needed to perform certificate signatures validation. However, this specific "resource" is not present in the list provided by the SSL module to the library. Hence, it does not validate certificate signatures even though the verification flag is set when creating SSL contexts, for example.

Impact

This vulnerability has a lot of impacts since it allows to spoof and perform MitM on any SSL/TLS connection established through the SSL module. Here is a (probably non-exhaustive) list of what can done:

  • spoofing the NetUpdateSOAP and ECommerceSOAP endpoints used by the NIM module to:
  • bypass the system update verification
  • provide customized system updates packages (still need titles with CommonETickets)
  • this probably allows (untested) to install titles that came preinstalled on special editions like Super Smash Bros, Pokemon games, Zelda games etc.
  • spoofing the eShop servers, providing a new attack surface (eShop app)
  • MitM eShop communications to:
  • get user information & tokens
  • spy on commercial transactions
  • get user banking information (?)(untested)
  • MitM Friends & ACT communications to:
  • get user tokens & information (including NNID credentials)
  • spoofing connections to some game servers, providing new attack surfaces
  • MitM connections to some game servers, allowing to spy on communications
  • MitM/spoofing any other connection using the SSL module to establish SSL/TLS communications

And some things that cannot be done:

  • it is impossible to modify downloaded SpotPass data which are protected due to the signature verification of BOSS containers
  • it is impossible to spoof servers or doing MitM attacks when applications use some kind of webkit implementation, due to webkit having its own SSL/TLS implementation

How it was found

The write-up for this report has not been downloaded yet, or the program disclosed it without one. Read it on HackerOne.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original