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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:22:44+00:00 2026-05-26T11:22:44+00:00

So we have a custom logger (really wanted to use Log4Net, just wouldn’t work

  • 0

So we have a custom logger (really wanted to use Log4Net, just wouldn’t work for this case). From a config file, you can configure the name of the table that will be inserted into.

I am parameterizing the insert statement, but the configurable table name will be used in an insert statement, and it’s a potential vector for attack. Here’s an example of the statement that will be built:

"insert into " + theTableName + " (static column list) values(parameterized list of values)"

So my inserted values are parameterized, and pretty safe, it’s theTableName that could contain nasties.

My question is, what can I do to sanitize the table name? I think the nature of the code an attacker would inject would have to be a little different from the garden-variety. — instead of a tick, you would potentially close off the statment with “table name() values(); do something bad —

(or something like that, I suppose). To that end, I was thinking about checking for the “;”, and the “–“.

Can anyone suggest a better way to sanitize this? (this will be used with Oracle and SQL server)

  • 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-26T11:22:45+00:00Added an answer on May 26, 2026 at 11:22 am

    I think you have a potentially bigger problem, which is that the user could specify a syntactically safe and valid table name that simply doesn’t exist in the database.

    Therefore, I’d do this:

    1. Build the INSERT string (including the table name) only once, when you load the config file.

    2. Verify the table name at that time by checking the system metadata to ensure that it’s a real, valid table.

    At that time you can warn the user that logging is off because the table “theTableName” does not exist in the database.

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

Sidebar

Related Questions

I have custom coded several enterprise applications for mid to large organizations to use
I have custom errors configured in my web.config, but IIS 6.0 is returning the
i have custom cell with 2 buttons(the function of these buttons is just to
hi i would like to create a custom calendar, this calendar will have custom
Ok this is a really annoying bug that I have been having issues with
I'm developing an Asp.net (MVC but this doesn't really matter) application. I have a
In this tutorial he creates a custom login form, just to show how it
I want to have a custom logger for my application, which of course logs
I have set up some WCF services that I use to call from javascript
I have custom event logger, and I want to test it. [Test] public void

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.