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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:58:52+00:00 2026-06-03T14:58:52+00:00

I am using a static analysis tool that find bugs and reports warning on

  • 0

I am using a static analysis tool that find bugs and reports warning on the following code

response.sendRedirect(response.encodeRedirectURL(redirectToXXX));

the warning says:

This code directly writes an HTTP parameter to an HTTP header, which
allows for a HTTP response splitting vulnerability.

But when I do it like this:

redirectToXXX= java.net.URLEncoder.encode(redirectToXXX.toString(),"ISO-8859-1");
response.sendRedirect(response.encodeRedirectURL(redirectToXXX));

the warning disappears.

What I don’t understand is that encodeRedirectURL is supposed to encode the url if necessary, so why does it generates a warning then, and remove the warning when encoded with URLEncoder.encode.

  • 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-03T14:58:53+00:00Added an answer on June 3, 2026 at 2:58 pm

    I believe that in the second case, the warning disappear because URLEncoder.encode remove CR and LF that could be contained in the parameter you are taking from the request.

    You might want to read this to understand the background of the HTTP response splitting vulnerability.
    I believe also that since the call to URLEncoder.encode returns a new object, FindBugs doesn’t reconduce that variable to the HTTP Request content, so it considers it safe.

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

Sidebar

Related Questions

I am analyzing the following piece of code using a static analysis tool called
Is there a way in llvm that using static analysis, i can find out
I am using PC-Lint (great tool for static code analysis - see http://www.gimpel.com/ )
I have been reading that creating dependencies by using static classes/singletons in code, is
I ran a static code analysis tool on our tool and looking at its
We're using VS2008 with the built in static code analysis rule set. We've got
So I started using FlexPMD for static code analysis, and I want to add
I'd like to write a static code analysis tool for finding SQLi vulnerabilities in
I am doing static code analysis (Using Gimpel PC- Lint) of my source code.
I have the following code public static byte[] Compress(byte[] CompressMe) { using (MemoryStream ms

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.