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 pushed a commit to GitHub. Is it possible to remove this commit?
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
I've accidentally removed Win2K compatibility from an application by using GetProcessID . I use
I accidentally uninstalled the Asp.Net MVC 2 Tools for Visual Studio 2010. How can
I came across this issue accidentally when I was going over inheritance and up/down
Accidentally I may forget to describe some parameters or exception throwing (or something else)
I accidentally added a binary file to SVN with the add command, and now
I accidentally committed too many files to an SVN repository and changed some things
Everyone has accidentally forgotten the WHERE clause on a DELETE query and blasted some
My friend accidentally bought a laptop with Windows Vista Home Basic Edition. He figured

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.