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 717001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:21:46+00:00 2026-05-14T05:21:46+00:00

If I accidentally double escape a string, can the DB be harmed? For the

  • 0

If I accidentally double escape a string, can the DB be harmed?

For the purposes of this question, let’s say I’m not using stored procedures or parametrized queries

For example, let’s say I get the following input:

bob's bike

And I escape that:

bob\'s bike

But my code is horrible, and escapes it again:

bob\\\'s bike

Now, if I insert that into a DB, the value in the DB will be

bob\'s bike

Which, while is not what I want, won’t harm the DB. Is it possible for any input that’s double escaped to do something malicious to the DB assuming that I take all other necessary security precautions?

  • 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-14T05:21:47+00:00Added an answer on May 14, 2026 at 5:21 am

    Single escaping is equally as harmful/harmless as double escaping in terms of security.

    The biggest issue is that you need to double-unescape. Otherwise, if you only single-unescape, you will end up with backslashes in database output.

    For example, if you run bob\\\'s bike through the unescape() function, it will output bob\'s bike which will then be printed to the page, unless you unescape it again. But don’t unescape too many times, because this can remove intentional backslashes (and possibly do more harm).

    Does this question have anything to do with PHP’s magic quotes feature by chance? Just curious…

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

Sidebar

Related Questions

I accidentally added my project to a folder. How can I undo this? Here's
If I accidentally double-click a button on a Winform in the visual studio designer
Accidentally I have been using a @synchronized block with the semaphore self in a
accidentally at work I wrote the following line of code: string x = (object)
Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed
Accidentally, by using a GUI as opposed to CLI, I removed every file in
I noticed this accidentally one day, and now decided to test it extensively. So,
Accidentally I delete project .settings folder from directory where located Java project. In this
I accidentally closed the Properties tab in Eclipse. I need this to do some
I accidentally cleared all my app's config vars using Heroku documentation (it should have

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.