views:

484

answers:

1

We have a problem in a specific server. All plus signs posted to the application are replaced with spaces - that's in POST and GET, and on all pages on that site.
As a test case I have this little page (it's an ASP server):

<html>
<body>
  <form method="post">
    <input type="text" name="Plus" id="Plus" />
    <input type="submit" />
  </form>
  Previous Value: <%= request("Plus") %><br />
  Query String: <%= request.querystring %>
</body>
</html>

On every other server this works well, but on one server pluses are replaced with spaces.
Example: for the input "1 2+3" - request("Plus") is "1 2 3", and the Query String is "1+2+3". No good. Other characters seem to be decoding correctly.
It should be said someone had tried to 'harden' this server against attacks, so obscure IIS options may be turned on (though we did remove the ISAPI filter).
Thanks.


UPDATE: It turns out there's another filter installed, the SQL Injection Filter ISAPIClipSQLInjection.dll from http://www.codeplex.com/IIS6SQLInjection .
The filter is buggy - it replaces valid characters from POST and GET:

  1. Plus signs are replaced with spaces: "1%2B2" -> "1+2", same as "1 2"
  2. Semicolons are replaced with Commas: "hello;" -> "hello,"

A newer version of the filter (2.0b) does not fix this, but allows to exclude certain pages. Since it is installed in production we decided not to remove the filter, we used javascript to change all pluses to "&#43 " (with space and not a semicolon).
Not the optimal solution, but that's what the boss wanted.

+1  A: 

Consider Ascii Code. In the place of a plus sign use its ascii code.It would be chr(43). Both asp and sql would understand this.

here is a table with all ascii codes. http://www.asciitable.com/

Eric
That's not an excellent solution, but it works. I'll accept your solution because that little patch is what we did eventually. Thanks anyway.
Kobi
Not to get too personal, but I noticed you live in Israel. How is it out there as far as living. Is it as bad as our Media portrays it? I want to go out there soon because I love the culture and the people.
Eric
It's a big fun, but this is hardly the place to talk about that. Feel free to contact me by any way (my blog has a few links)
Kobi