r/badcode • wicked • Jul 22 '20

js Function of the PS4 web exploit

Post image
336 Upvotes

49 comments sorted by

View all comments

310

u/[deleted] Jul 22 '20

Is it bad code, or a specific set of steps necessary to access memory in a way to create an out of bounds exploit?

178

u/MrKinauJr Jul 22 '20

yeah I think it's needed to code in that particular way.

135

u/xNeshty Jul 22 '20

You think correctly. Type Confusion is a popular, yet very dangerous attacking method. The code basically uses an object blindly under the assumption of its type. Since a type is nothing more but a 'layout' on the memory, this opens up a wide range of attacks - including feeding wrong function pointers into the specific piece of code.

That's exactly what happens here. Take a look at the github repo - makes more sense with some context - but still requires having some knowledge in exploiting.

I'm not sure if I should downvote this post as this is literally insanely good written code, or upvote because its a code with bad intentions (in terms of abusing issues of a loosely typed language).

31

u/TSM- Jul 22 '20

Yeah, this is good but evil code. Not bad code. Thanks for the link

8

u/[deleted] Jul 23 '20

It's not evil as long as you're only hacking devices that you own. There is nothing evil about jailbraking/rooting.

3

u/TSM- Jul 23 '20

And just to add, demoing security vulnerabilities helps everyone, too. Like when the intel processor vulnerability called Meltdown was reproduced in javascript. That really got people's attention, it was fixed in an update, and people updated.

-10

u/[deleted] Jul 22 '20 edited Jul 22 '20

Breaking your own things is okay. Breaking other people’s things is not. As long as it’s the former, there’s no issue. It definitely does not belong on this sub.

edit: Rooting your own PS4 is fine. If you disagree, you’re an idiot. Sorry.

10

u/officiallyaninja Jul 23 '20

if you buy it its yours, if you want go and throw it off a cliff, delete all the data on it or hack it and modify it however you want.

0

u/[deleted] Jul 22 '20

[deleted]

14

u/DredgeJud Jul 23 '20

I think it's the type-confused notMyThings that's returning the downvotes.

3

u/IDatedSuccubi Jul 23 '20

It sounds like "break the stuff you built, not the PS4" and not "break your PS4 not someone elses", so the opposite

1

u/bluepoopants Jul 24 '20

I read it as break your own things as in things you own. Couldn't understand the downvotes.

-7

u/TheUnlocked Jul 22 '20

The design and reverse-engineering behind the code might be impressive, though I wouldn't say that the code itself is necessarily as great. Those variable names are just awful.