Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4120952
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:17:20+00:00 2026-05-20T23:17:20+00:00

I have an existing MySQL database schema in production for an PHP5 application. The

  • 0

I have an existing MySQL database schema in production for an PHP5 application. The application was built in a popular MVC framework (which one isn’t important). We use Doctrine ORM 1.2.x as out ORM.

The default routing used a primary id, in our case simply an unsigned auto incremented integer. However some of the data is sensitive, and although we run under SSL, changing an ID value in the url could potentially give access to confidential data a user is not authorized to see.

The solution as I see it is to use some obscured value in place of the more obvious record ID.

Ideally we would just add a new column to affected table and generate some unique random or hashed value for that record right?

However, I can conceivably see a couple other tables/routes being in need of the same treatment sooner or later, and would like a reusable solution that can avoid a series of database updates. So I’ve been thinking about alternative methods and would like opinions on whether there are any major issues to be concerned about.

  • simple obfuscating the value, i.e. shifting bits and/or base 64 encoding
  • quick and nasty encryption
  • using hmac to ensure the id given matches the given hmac

update As mentioned by Charles, ACLs would be a preferred solution, however some portions of the site are open to the public, so ACLs for these areas are not possible. We do however make extensive use of ACL in the applications backend.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:17:20+00:00Added an answer on May 20, 2026 at 11:17 pm

    changing an ID value in the url could potentially give access to confidential data a user is not authorized to see.

    Shouldn’t your code have access controls that would prevent this from happening? That’s going to be a more sane solution than the "security through obscurity" that obfuscated identifiers is going to bring you.


    Ideally we would just add a new column to affected table and generate some unique random or hashed value for that record right?

    Yup! Just remember to mark the column as UNIQUE.

    So I’ve been thinking about alternative methods and would like opinions on whether there are any major issues to be concerned about.

    The three options you mentioned are silly in their own ways. All you need is a unique identifier for that row in that table. Pull some entropy out of thin air and encode enough of it, and bingo, you have your unique identifier. Don’t get too clever, you’ll find yourself with a self-inflicted bullet through your foot. Don’t make the random data based on a hash of the contents or the row’s existing sequential identifier. The HMAC could be good enough here.

    On the other hand, I wouldn’t have the faintest idea on how to hook your ORM up to the new identifier, or have it generate one for you when also creating new rows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing database in mysql. One of my tables has discontinuous ids.
I have an existing database in production. I have exported the schema with liquibase
I have a mysql database which have set of tables One table have a
I have a mysql database and the application which connects to it, dumps required
I have a existing MySQL database which has large number of tables. But the
I have an existing application (with MySQL DB). I just got a new requirement
I have a pre-existing mysql database containing around 50 tables. Rather than hand code
Trying to dump the schema for an existing MySQL database. Appears the best way
I have a table called jobs in a MySQL database. One user adds data
I have an existing database schema managed by another webapp. The playframework I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.