Support the ongoing development of Laravel.io →
Configuration Security Requests

So, I am working on a product and using ID's in the URL and not using slugs.

The only point I know devs use slugs instead of ID's is the fact that firstly it's an SEO enhancement, secondly it's minimal security as no one likes seeing ID's in URL's (pretty URL's).

I want to know whether using an ID is dangerous and whether a user can get all the data via curl or something.

It's a conversation, not asking for the solution, of course I'm implementing slugs now.

Last updated 3 years ago.
0

Not dangerous in itself, as you would have authorisation controlling if a page is view-able or not by the user requesting it.

0

if you're using auto incremented ids then the user might predict total number of users, in table or might try typing random numbers. If you're using UUIDs exposing a user id won't be a security issue.

0

Only dangerous if you arent concerned about others finding out the size of your database. Use UUID's and mask the id's.

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

dhuzz dhuzz Joined 5 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.