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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:52:08+00:00 2026-05-14T01:52:08+00:00

Maybe this isn’t really feasible. But basically, I’ve been developing a snippet-sharing website and

  • 0

Maybe this isn’t really feasible. But basically, I’ve been developing a snippet-sharing website and I would like it to have a ‘live demo area’.

For example, you’re browsing some snippets and click the Demo button. A new window pops up which executes the web code.

I understand there are a gazillion security risks involved in doing this – XSS, tags, nasty malware/drive by downloads, pr0n, etc. etc. etc.

The community would be able to flag submissions that are blatantly naughty but obviously some would go undetected (and, in many cases, someone would have to fall victim to discover whatever nasty thing was submitted).

So I need to know:
What should I do – security wise – to make sure that users can submit code, but that nothing malicious can be run – or executed offsite, etc?

For your information my site is powered by PHP using CodeIgniter.

Jack

  • 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-14T01:52:09+00:00Added an answer on May 14, 2026 at 1:52 am

    As Frank pointed out, if you want to maintain a high level of security use a whitelist technique. This of course comes with a price (might be too restrictive, hard to implement).

    The alternative route is to develop a blacklist technique. i.e. only allow code that hasn’t triggered any bells. This is easier, because you have to specify less things, but it will not catch new exploits.

    There is plenty information available on the web on both techniques.

    Relying on CodeIgniters security functions (XSS filtering etc.) will not get you very far as most of the snippets will not be allowed through.

    Whatever you do you have to remember this:

    Do not think malicious code will aim to just harm your website’s visitors. It may as well aim to compromise your server via your parser/code inspector. For example, lets say Alice uploads snippet foo. Alice intentionally crafts the snippet so that your parser will flag it as malicious due to an XSS exploit. Lets say your parser also updates a database with the malicious snippet for further investigation. Alice knows this. Along with the XSS exploit Alice has injected some SQL code in the snippet, so that when you INSERT the snippet to the database it will do all sorts of bad stuff.

    If you are really paranoid, you could have an isolated server which its solely responsibility would be to inspect code snippets. So in the WCS only that low-risk server would be compromised, and you would have (hopefully) enough time to fix/audit the situation.

    Hope this helps.

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

Sidebar

Related Questions

Maybe this isn't even a valid question, so any help would be good.
Ok, maybe this isn't so amazing considering I don't really understand how the debugger
Maybe this isn't possible, I've never seen it myself, but thought I'd ask. If
Maybe this is a dumb question, but is there any way to convert a
Maybe this is a dumb question, but I have the following behavior in Visual
Maybe this cannot be done, but please help or suggest how this can be
This maybe a stupid question, but as I can not easily undo my change
I know this maybe a very basic question but I'm having a bit of
I know this maybe a basic question but I just can't seem to find
I know next to nothing about SharePoint, so maybe this isn't something you can/should

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.