What could possibly go wrong. Little Bobby Tables would be proud.
GraphQL:


Lmfao
Exposed deprecated cred-inclusion URI format, wheeeee
And the db name is short for “analysis”, of course
🤓🫠
And the db name is short for “analysis”, of course
This person was probably a scientist (of any kind).
But also, perhaps a proctologist
Analytics, most likely
This is still over engineered. Just connect directly to the database from the client instead of having an API endpoint.
Too much overengineering there as well. Just copy the entire database into a google spreadsheet
I thought that was the joke.
grapql in a nutshell
Great idea. How can we submit this to all AI scrapers?
/cybersec red teamer
I got dumped with fixing some bugs in a project written by a contractor who had literally done this but with extra steps.
Backend was sql server and c#/asp.
There was an api endpoint that took json, used xslt to transform to xml. Then called the stored procedure specified in request passing the xml as a parameter.
The stored procedure then queried the xml for parameters, executed the query, and returned results as xml.
Another xslt transformed that to json and returned to the client.
It was impressive how little c# there was.
Despite holding all the business logic, the sql was not in source control.
Worst thing with databases. Used to quote to my interns, “No spooky action at a distance” logic has to be in front of you and in git. Anything else is a recipe for bugs and undetectable errors.
Seems very secure. As in job security. Because why the fuck did they make it so complicated.
Yeah, maybe the contractor thought he’d get more work fixing it but he was long gone by the time I got it so i never met him
One of bugs I got was performance because the search didn’t work, with about 600,000 assets in database it would timeout searching for one by exact match on ID. It took 45 minutes to return 1 result.
/anal
That’s a backdoor
it’s called microservice
I did this just to reduce network latency. It’s not for public use, and tbh, I don’t think you can even get at it from outside the VPN.
Pentesters: “Bet”
I haven’t been down to test their public wifi in the cafe to see if that can access it.
The guy who installed it used to work for us and is a known clown, so it’s entirely possible.
Although if it is, there’s way worse things they can do from there. Like connect to the actual database for a start.
Does the database use the same authentication and permissions as the API? If the API authenticates against the DB with a technical user, it may be still be an exploitable vulnerability for people who can’t access the DB directly but can access the API. I don’t know what database it is, what other databases run on the same server and what privileges might be achievable or escalatable, but generally “there are worse weaknesses” isn’t a solid security policy.
You could give me a VPN access and I’ll take a look around :p
(Please don’t, actually – in case it needs to be said, running pentests on prod is a dangerously bad idea already even before we get to the whole “trusting a stranger on the Internet just because they sound sorta knowledgeable” issue)
It’s not that bad that you might think, the db user just need to have readonly access permissions to specific database tables.
Ofc all data in tables ofc need to be public, so more like simple public facing page, app should not have any notion of users in any way, data probably populated by some automated system, and UI just to make it easier for anonymouse users to view that data in a friendly way.
On top of that it will be a hell for the sysops as they will need to know the whole db structure and such of even a single part of db would contain non-public data, but that overall the best guy to handle security in the first place.
And because all data is totally public in the first place you could give the task of creating frontend to any junior or LLM and it will be still secure.
But in truth it is very bad idea (even it it is possible), because most likely the database connections would be reused so you could for example change current connection session timezone or other params and that ofc would nit change the data in db but still could affect other users by showing wrongly formatted or shifted data.
CouchDB (a no-sql db, but whatever) automatically provides a REST API that’s designed to be exposed directly to clients. It even implements its own client-facing authentication system. “queries” are configured in advance from the admin side, and clients just pull the results, allowing for very efficient caching. Basically, if you RTFM enough to get a couchdb instance running, you have 90%-100% of your backend complete. You could create an entire scalable full-stack app using only client-side code… and if you’re clever with HTMX, you might even be able to do it without writing any javascript at all! (I tried once, but failed because I’m not that clever, but it’s definitely probably possible)
So TL;DR: I like couchdb, and the idea of exposing your database directly to users isn’t unprecedented. I wonder if there are any SQL databases that offer a similar thing?
Most DBs have some way to reset reused connections. Postgres is one of those.
The actual problem, even with public data, is that it’s trivial to overload a database with bad queries.
deleted by creator
It’s just like using MongoDB instead of a structured database!
deleted by creator
I wish I could go back to rest apis. My company is all in on graphql and it fucking sucks so much ass.
I mean…. Let’s say you set up a Postgres user for all of your application users, with appropriate roles and row level security policies, you could actually do it without Bobby tables issues. I think.












