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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:41:22+00:00 2026-06-12T07:41:22+00:00

I have a Jersey app that has been run through our corporations website vulnerability

  • 0

I have a Jersey app that has been run through our corporations website vulnerability tool. It came back with a vulnerability that is quite odd. If you send in this header:

"*/*'"!@$^*\/:;.,?{}[]`~-_<sCrIpT>alert(81363)</sCrIpT>"

You get an error message back in the BODY from jersey:

The HTTP header field "Accept" with value "*/*'"!@$^*\/:;.,?{}[]`~-_<sCrIpT>alert(56224)</sCrIpT>" could not be parsed.

This is not acceptable to our Security Team. It does come back as “text/plain” which is correct and all, but I need to change the message. Any way to do this?

This is running on Tomcat and I am using Jersey 1.14.

  • 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-12T07:41:24+00:00Added an answer on June 12, 2026 at 7:41 am

    This is from Pavel on the Jersey team:

    You should be able to purge the entity from your servlet filter, or you can register ContainerResponseFilter in Jersey, something like:

    public class PurgeErrorEntityResponseFilter implements ContainerResponseFilter {
        @Override
        public ContainerResponse filter(ContainerRequest request, ContainerResponse response) {
            if(response.getStatus() == 400) {
                response.setEntity(null);
            }
            return response;
        }
    }
    

    and web.xml:

     <init-param>
           <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
           <param-value>x.y.z.PurgeErrorEntityResponseFilter</param-value>
       </init-param>
    

    This worked for me. I did this:

    response.setEntity(StringEscapeUtils.escapeHtml(response.getEntity().toString()));
    

    and it escaped the error message. Thanks Pavel!

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

Sidebar

Related Questions

I have a jersey client that is getting JSON from a source that I
I have an Jersey API that returns Odata standard responses and consumes the same.
I have implemented a test method with Jersey to run on my Google AppEngine
Using Jersey, I want to be able to have a GET request, that would
I have written a REST web service with Jersey Server (that totally rocks !).
I'm developing a web app where i have a form like that <form name=form
I have a Jersey REST service with a resource class that calls methods on
I'm using jax-rs (jersey) to create a website / web-service that other users can
I have a web app that is using Bayeux to handle Comet connections. I
I'm developing an app with Jersey where I have many resources. Although main functionality

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.