r/PHPhelp • u/aliosayle • Feb 08 '25
Security issue with script to fetch data dynamically
Hi,
I'm working on a PHP script to serve as a unified script for all frontend table pages. It functions in a way that the frontend sends the table name and column names, and the backend script then retrieves the data. This approach avoids loading all the data at once, which can be time-consuming for large datasets. The script also supports search and conditional queries.
I posted this on r/php for assistance, but I was informed that the script has several security vulnerabilities. The post request can be intercepted, allowing users to query any table they desire. I'm hoping someone can help me address these issues.
Here's the GitHub repository for the project: https://github.com/aliosayle/php-datatable-with-backed-processing.git
View all comments
Show parent comment
1
u/colshrapnel Feb 09 '25 edited Feb 09 '25
If CSV isn't a database, then Sqlite isn't either.
Yes, I get your point, anything with data is a database. That's fair. Still it helps to think of various implements branded with umbrella term "noSQL" as supplementary utilities, not as databases.
For the main database you are using a software that organizes your data in a sensible way, looks after the data integrity and overall reliable. While for the various specific tasks you could use
and so on, so on, so on. You cannot use any of them as a general purpose database. They are tools, not databases.
The same goes for Mongo. It had its use when real databases was too clumsy with unstructured data. So you had a pain of coupling your database with Mongo. But now it's a no-issue as every major database can do everything Mongo can but also being a database. Hence, even as a specific tool Mongo has no use nowadays.