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

  • Home
  • SEARCH
  • 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 878973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:51:12+00:00 2026-05-15T11:51:12+00:00

I have a specific case here in which I would like some security advice.

  • 0

I have a specific case here in which I would like some security advice. Basically my question is “If I control what is in a database (no user submitted data), is there a security concern to returning the results of a database query in HTML (via AJAX)”?

Here’s the process that is happening:

  1. daily build generates an XML doc
  2. My server retrieves this XML doc, parses it (with PHP) and enters it into a database.
  3. User goes to site, the AJAX request is sent (parameters include number of results to return, how to sort, and a search term if necessary)
  4. PHP script queries the database returning the results to the AJAX callback
  5. AJAX callback injects the result into the page for viewing

Pretty standard stuff…

Some more background: I use prepared SQL statements, so that limits the user supplied search query and any URL tampering to create an arbitrary query. The XML file is alphanumeric only, no code. The reason that I want to return HTML is to limit client-side work as much as possible, with HTML, there’s no need to fuss with JS to generate the page (except to use jQuery to inject the html block).

Any suggestions for me?

Thank you in advance.

PS – this is still in the planning stage, so there’s no real code to show.

  • 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-15T11:51:12+00:00Added an answer on May 15, 2026 at 11:51 am

    As long as you control the input 100%, there is very little risk of injection or XSS attacks. Any attacks that can take place such as replacing part of or injecting into the response over the wire, would happen no matter what security measures you have in place.

    Just keep your database secure.

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

Sidebar

Related Questions

I have a specific class C and I would like to overload some math
I have a specific case in mind, but the question applies in general too.
i have this specific question to do to you, i have a database from
I have a page which contains several tables, and I would like to format
Here's a puzzle for you guys. I have a multithreaded program in which some
I have a very specific case that I need to debug. I need to
I have a quite specific client-server design case and I want to ask for
I have a specific question about looping variable names in WPF. XAML code looks
I have an existing SQL Server database, where I store data from large specific
I have a very simple case that I think would benefit from using templates

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.