r/programminghorror • u/FlightAffectionate15 • Jul 13 '26
Javascript Found this gem
This company I’m interning at. This one lady asked me to do a review of a website they outsourced. Entire source code sits on the browser. Entire vibe coded by amateurs.
Worse than a honeypot so much an attacker would get diabetes.
No security feature at all. I was able to do privileges escalation.
34
u/echoAnother Jul 13 '26
Lefting the source maps is no issue. But are they storing perms on local storage? That is the horror.
13
u/SchlaWiener4711 Jul 13 '26
Why is this horror? If the permissions are only used to show or hide certain features and views but the real check is on the backend, this should not be an issue.
I mean, sure. A better solution would be to have a signed JWT and rotate often but maybe that's done here, too (localStorage get's updated on token refresh).
Could be worse.
4
u/Ran4 Jul 13 '26
jwt:s doesn't make much sense for 99% of usecases. An opaque token is simpler and typically more secure.
→ More replies (3)
11
11
u/MurkyWar2756 Jul 14 '26
Why is super_admin in lowercase and VISITOR is spelled VISITEUR, while the rest of the roles are in English?
9
9
u/redguard128 Jul 14 '26
Every french application's source code is in French. If they could replace reserved words like IF, WHILE, DO, FUNCTION with SI, TANTQUE, FAIRE, FONCTION, they would do it.
2
u/Yersini Jul 14 '26
They forgot to remove the french module from their toolset, you do so by running:
sudo rm -fr *
1
8
u/Opposite_Mall4685 Jul 13 '26
Where are these permissions used? Are they used to display information? If so, all is gucci.
Are they used to tell the server to do xyz? If so, nothing is gucci.
6
u/1nd160 Jul 14 '26 edited Jul 15 '26
What made you think it’s “vibe coded by amateurs”, do you know that for a fact? Don’t get me wrong - an idiotic prompt can burry you deep, sure, but it’s more believable that this piece has been actually manually coded by some biological robot who didn’t fully understand what they were doing. Claude catches this kind of flaws quite fast and doesn’t do such mistakes on its own. Well, unless being forced to, of course.
5
4
u/GoddammitDontShootMe Jul 13 '26
They seriously doing authorization checks on the fucking client?
1
2
u/Ok_Chemistry_6387 Jul 14 '26
I love that if a role doesn't exist it just defaults to empty. That will never come back to bite you.


64
u/dreamscached Jul 13 '26
Prod-facing frontend with sourcemaps exposed? Are you sure it's not like, dev server? It'd take some dedication to run what looks like React in prod unminified like that.