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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:38:21+00:00 2026-05-16T12:38:21+00:00

our company has made a website for our client. The client hired a webs

  • 0

our company has made a website for our client. The client hired a webs security company to test the pages for security before the product launches.

We’ve removed most of our XSS problems. We developed the website with zend. We add the StripTags, StringTrim and HtmlEntities filters to the order form elements.

They ran another test and it still failed 🙁

They used the following for the one input field in the data of the http header: name=%3Cscript%3Ealert%28123%29%3C%2Fscript%3E which basically translates to name=<script>alert(123);</script>

I’ve added alpha and alnum to some of the fields, which fixes the XSS vulnerability (touch wood) by removing the %, however, now the boss don’t like it because what of O’Brien and double-barrel surnames…

I haven’t come across the %3C as < problem reading up about XSS. Is there something wrong with my html character set or encoding or something?

I probably now have to write a custom filter, but that would be a huge pain to do that with every website and deployment. Please help, this is really frustrating.

EDIT:
if it’s about escaping the form’s output, how do I do that? The form submits to the same page – how do I escape if I only have in my view <?= $this->form ?>

How can I get Zend Form to escape it’s output?

  • 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-16T12:38:22+00:00Added an answer on May 16, 2026 at 12:38 pm

    %3Cscript%3Ealert%28123%29%3C%2Fscript%3E is the URL-encoded form of <script>alert(123);</script>. Any time you include < in a form value, it will be submitted to the server as %3C. PHP will read and decode that back to < before anything in your application gets a look at it.

    That is to say, there is no special encoding that you have to handle; you won’t actually see %3C in your input, you see <. If you’re failing to encode that for on-page display then you don’t have even the most basic defenses against XSS.

    We’ve removed most of our XSS problems. We developed the website with zend. We add the StripTags, StringTrim and HtmlEntities filters to the order form elements.

    I’m afraid you have not fixed your XSS problems at all. You may have merely obfuscated them.

    Input filtering is a depressingly common but quite wrong strategy for blocking XSS.

    It is not the input that’s the problem. As your boss says, there is no reason you shouldn’t be able to input O'Brien. Or even <script>, like I am just now in this comment box. You should not attempt to strip tags in the input or even HTML-encode them, because who knows at input-time that the data is going to end up in an HTML page? You don’t want your database filled with nonsense like 'Fish&amp;Chips' which then ends up in an e-mail or other non-HTML context with weird HTML escapes in it.

    HTML-encoding is an output-stage issue. Leave the incoming strings alone, keep them as raw strings in the database (of course, if you are hacking together queries in strings to put the data in the database instead of parameterised queries, you would need to SQL-escape the content at exactly that point). Then only when you are inserting the values in HTML, encode them:

    Name: <?php echo htmlspecialchars($row['name']); ?>
    

    If you have a load of dodgy code like echo "Name: $name"; then I’m afraid you have much rewriting to do to make it secure.

    Hint: consider defining a function with a short name like h so you don’t have to type htmlspecialchars so much. Don’t use htmlentities which will usually-unnecessarily encode non-ASCII characters, which will also mess them up unless you supply a correct $charset argument.

    (Or, if you are using Zend_View, $this->escape().)

    Input validation is useful on an application-specific level, for things like ensuring telephone number fields contain numbers and not letters. It is not something you can apply globally to avoid having to think about the issues that arise when you put a string inside the context of another string—whether that’s inside HTML, SQL, JavaScript string literals or one of the many other contexts that require escaping.

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

Sidebar

Related Questions

Our company has a product which relies on local database to work (it allows
Our company has an intranet with 30,000+ web pages and 160+ web applications. This
Our company has many different entities, but a good chunk of those database entities
My company has a ClickOnce application that has been in use with our customers
There are 3 authors in our company blog, each author has own site url
In C# our maintainance project, we observered that the previous company has a root
We've recently moved our company website to a new host. It is an ASP.NET
Our company has an intranet consisting of several e-mail templates filled with variables (like
Our company has offices in the US and the UK. We have a MOSS
Our company has a project that right now uses nginx as a reverse proxy

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.