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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:05:17+00:00 2026-05-30T01:05:17+00:00

I found it inside the symphony CMS app, it’s very small: https://github.com/symphonycms/xssfilter/blob/master/extension.driver.php#L100 And I

  • 0

I found it inside the “symphony CMS” app, it’s very small:

https://github.com/symphonycms/xssfilter/blob/master/extension.driver.php#L100

And I was thinking of stealing it and use it in my own application to sanitize string with HTML for display. Do you think it does a good job?

ps: I know there’s HTML Purifier, but that thing is huge. And I’d rather prefer something less permissive, but I still want it to be efficient.


I’ve been testing it against strings from this page: http://ha.ckers.org/xss.html. But if fails against “XSS locator 2”. Not sure how can anyone use that string to hack a site though 🙂

  • 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-30T01:05:20+00:00Added an answer on May 30, 2026 at 1:05 am

    No, I wouldn’t use it. There are many different attacks that all depend on the context the data is inserted into. One single function would not cover them all. If you take a close look, there are actually just four tests:

    // Set the patterns we'll test against
    $patterns = array(
        // Match any attribute starting with "on" or xmlns
        '#(<[^>]+[\x00-\x20\"\'\/])(on|xmlns)[^>]*>?#iUu',
    
        // Match javascript:, livescript:, vbscript: and mocha: protocols
        '!((java|live|vb)script|mocha):(\w)*!iUu',
        '#-moz-binding[\x00-\x20]*:#u',
    
        // Match style attributes
        '#(<[^>]+[\x00-\x20\"\'\/])style=[^>]*>?#iUu',
    
        // Match unneeded tags
        '#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>?#i'
    );
    

    Nothing else is tested. Besides attacks that these tests don’t detect (false negative), it could also report some input mistakenly as an attack (false positive).

    So instead of trying to detect XSS attacks, just make sure to use proper sanitizing.

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

Sidebar

Related Questions

I was just reviewing some old code and found the following (inside foo.asp): Const
I found that SO put the search input inside a form tag, and i
inside of my Zend_Db_Table_Rowset Object i found this: [_primary:protected] ... does anybody if theres
Below is some html I found in this jquery tooltip tutorial, the contents inside
How to add or open the asp.net pages from inside sharepoint? I found many
I found out that I can't target a object inside the main MC if
Okay I found this RSS plugin and I want to display it inside a
I just found out how to break into the SetTimer function inside a windows
I've found a bunch of iPhone objects inside interface builder, but I assumed there
I just found the following code inside a stored procedure. BEGIN SELECT @MyVar =

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.