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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:00:32+00:00 2026-06-12T13:00:32+00:00

I’m using antisamy for a new project, to prevent the xss vunerabilities. In the

  • 0

I’m using antisamy for a new project, to prevent the xss vunerabilities.
In the application, a user can upload content by an simple (ansi encoded) excel file.
It should be possible to insert some html but no possible insert javascript and so on.

when I scan my input with antisamy, i get this errors:
The a tag contained an attribute that we could not process. The href attribute had a value of “https& # 5 8 ;& # 4 7 ;& # 4 7 ;bla& # 4 6 ;bla& # 4 6 ;com& # 4 7 ;bla& # 4 7 ;…”. This value could not be accepted for security reasons. We have chosen to filter the a tag in order to continue processing the input.

I added some spaces in the entities, that you can see it.

(But it should be like https://bla.bla.com/bla/…)

When i debug thru the code, the ‘tainted Html input’ and its href attribute seems to be right (so there is no problem with encoding of the excel file).

The antisamy-policy file looks like this:

...
<regexp name="onsiteURL" value="([\w\\/\.\?=&amp;;#-~]+|#(\w)+)"/>
<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:)[A-Za-z0-9]+[~a-zA-Z0-9-_\.@#$%&amp;;:,\?=/\+!]*(\s)*"/>
...
<attribute name="href">
  <regexp-list>
    <regexp name="onsiteURL"/>
    <regexp name="offsiteURL"/>
  </regexp-list>
  <literal-list>
    <literal value="javascript:void(0)"/>
  </literal-list>
</attribute>
...

I also tested the regex pattern and as i thought the link was valid. Of course not, when it’s encoded by html entities.

So what’s the problem?

Thanks a lot in advance


I debugged thru the AntiSamy Code a bit and now I see the problem, but I sill can’t fix the problem.
The htmlentities were added by antisamy AFTER validation (if I would print it on an HTML page..). But my input will be parsed by org.cyberneko.html.parsers.DOMFragmentParser in the AntiSamy library with this statement:
parser.parse(new InputSource(new StringReader(html)), dom);
in my a tag the href attribute contains now something like this:
https://bla.bla.com/bla?frame=Frameset%5Bundefinable character]lang=en
insted of
https://bla.bla.com/bla?frame=Frameset&lang=en

So it seems to be an encoding problem, that the ampersand will not be an ampersand anymore.
How could find out, which encoding i should use?

Edit: The character is E2 8C A9 -> ⟨

  • 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-06-12T13:00:33+00:00Added an answer on June 12, 2026 at 1:00 pm

    I’ve done a little workaround by replacing the “&” with “&amp ;”.
    I don’t know why, but it works. And this is the only character which doesn’t work properly.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported

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.