Disable CC data for POST requests

Hi @all,

its me again :slight_smile:

Today, i am looking for a way to deactivate the CC check only for POST requests - is this possible?

My first idea was, to do this via an iRule - if a POST requests, than switch to another V-Server with a different ASM policy, but i am not sure is this a good way

Thanks

Bjoern

Hi Bjoern,

I can’t really see the value in only applying the attack signature to response content for non-POST requests. Chances are the only vulnerability within an application which would lead to credit cards being leaked in response content would be from POST requests. So why would you want to disable the check for POST requests and not all requests?

If you do want to do this an iRule and second policy would be an option. You could use the ‘HTTP::class select’ command (Click here) to select a second HTTP class for POST requests. Note the second HTTP class must also be added to the virtual server in order to select it using HTTP::class. Selecting a second virtual server would work, but unnecessarily add the need for a second virtual server.

Aaron

Hi Bjoern,

Like Hoolio said, most of the vulnerabilities today on the web are within POST requests, can you please share with us why would you want to do something like that?

Hi,

reason is, that in the reporting, the POST requests which include CC data is marked as “Information Leakage Detected”.

thanks

Bjoern

Hi,

Are you sure that the website doesn’t really leak credit cards numbers?

ASM validates that the string of numbers is actually a real credit card using a special algorithm.

Which ASM version you are using? 9.X or 10.x?

we using BIG-IP 9.4.6 Build 401.0 Final.

In this POST request, a customer send his CC data to buy something - the data he gets back is coded with stars

Here is a log extract - no, this CC is not real :slight_smile:

----Log-----

Full Request

POST /cgi-bin/payment.dll HTTP/1.1

Content-Length: 244

Content-Type: application/x-www-form-urlencoded

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Accept-Language: de-de

Cookie: webshop=cmVzZXJ2YXRpb25fZHVyYXRpb249MTI0NzEzNDgxNDc0NyZnaWZ0d3JhcHBlcl9mb3JtYXR0ZWQ9MCUyQzAwJnNoaXBwaW5nPTUuOTAmdG90YWw9MTc0LjEwJmN1cnJlbmN5X3N5bWJvbD0lMjZldXJvJTNCJmNvdXBvbl9mb3JtYXR0ZWQ9MCUyQzAwJnRpY2tldHByaWNlPTE2OC4yMCZpbnN1cmFuY2VfZm9ybWF0dGVkPTAlMkMwMCZpZD1FVkU3NjAxMzEyNDcxMzMxMDFYJnRpY2tldHByaWNlX2Zvcm1hdHRlZD0xNjglMkMyMCZwcmljZT0xNjguMjAmY3VycmVuY3lfY29kZT1FVVImc2hpcHBpbmdfZm9ybWF0dGVkPTUlMkM5MCZ0b3RhbF9mb3JtYXR0ZWQ9MTc0JTJDMTAmcmFuZG9tPTc2MDEzJmluc3VyYW5jZT0wLjAwJnByaWNlX2Zvcm1hdHRlZD0xNjglMkMyMCZnaWZ0d3JhcHBlcj0wLjAwJmFtb3VudD0yJmNvdXBvbj0wLjAwJm1lcmtpdGVtcz0wJnJlZmVyZXI9aHR0cCUzQSUyRiUyRnN0YWdpbmcuZXZlbnRpbS5kZSUyRmNnaS1iaW4lMkZ0aW5mby5kbGwlM0ZhZmZpbGlhdGUlM0RldmU=; HAHAHA+Deutschland_time=04045; CTG=1247133160; WSS_GW=V1z%BC@%B@riQ; s_nr=1247128127629; TSb9eef2=3f02746cdc4e67515cea09c98b1dccc048635239d4b8ba714a55bdc9; CP=null*

Referer: https://staging.testland.ha/cgi-bin/customer.dll

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11

X-Akamai-CONFIG-LOG-DETAIL: true

TE: chunked;q=1.0

Connection: TE

Akamai-Origin-Hop: 1

Via: 4.0 asi_server, 1.0 akamai.net(ghost) (AkamaiGHost)

Accept-ESI: 1.0

X-Forwarded-For: 127.0.0.1

Host: myhost.test.nowhere

Pragma: no-cache

Cache-Control: no-cache, max-age=0

Connection: keep-alive

Number: 88.79.247.30

akamaisession: candidate

Letter: second

X-Forwarded-For: 88.221.4.9

&action=payment&errordoc=globalError&kreditkarteInhaber=Fred%20Test&sent.y=0&sent.x=0&kreditkarteNummer=6677880000000004&sent=sent&affiliate=EVE&zahlungsart=2&kkMonth=02&kkYear=2012&fun=customer&nextdoc=summary&doc=payment&kreditkarteCvc=123

+ - Response

Response not found

Referrer Object

No records to display.

Cookie Name Cookie Value Reason

Parameter Name=Value Parameter Violations Parameter Level

No records to display.

XML Violation XML Buffer Description

No records to display.

Signature Name Signature ID Learn Alarm Block Context

No records to display.

Evasion Technique Detected Context

No records to display.

Pattern Context

Credit Card NumberkarteNummer" value=“6677880000000004” />

HTTP Protocol Compliance

Support IDTime

170052960248913480132009-07-09 11:53:21

Hi,

How the response look like?

In version 10 you can configure exceptions for the DataGuard using a regexp, however, I suggest to be careful to do so in your case.

I suggest to be careful since it seems that in your case, there is a high probability that teh application leaks credit cards numbers.

The response:

Kreditkartentyp VISA

Kreditkarten-Nr. ************0004

Gültigkeit 02/2014

For me, it looks like that the WAF interpret the POST data as the “Information Leakage Detected” and not the response of this POST.

This does not make sense, the webserver need the complete data for the payment - no data, no selling :slight_smile:

DataGuard is only working on response data. Please look at the responses of that page.

The DataGuard doesn’t touch or change anything in the request. It simply makes sure that sensitive information isn’t leaked in responses.

Hey Bjoern,

You may want to double-check the source of the page that is returned. Based on the ‘Context’ provided in the violation report, it looks like the number might be in a ‘hidden’ input field.

The context in the report certainly seems disparate from the example you posted, so perhaps this is the disconnect. Maybe open the page, view source, and try to find the whole number or the “karteNummer” string in which we can see it in the below sample:

Pattern Context

Credit Card Number karteNummer" value=“6677880000000004” />

It definitely appears that the whole card number is being sent back to the user-agent, probably as a form element. This means it won’t appear on the page, but is still an element in the form that the user-agent will transmit back.

// Ben

I checked it servial time, with differnd tools.

I saw always the correct, with stars coded data.

Attached the request, response and log

Hey Bjoern,

Do you have DataGuard masking the content? If so, and this request is coming through the ASM, then it will definitely be all stars when it returns.

This is probably too obvious a question, but do you see the same come back from the server when you connect to the web server directly or when DataGuard is not enabled?

// Ben

our apps do the masking the the contend

Hey Bjoern,

There certainly appears to be something other than the request, just based on the data above. DataGuard should certainly only trigger on response data, so if you are certain that it is happening on the data in the request, I would say that a case with F5 Support is warranted.

Again, however, judging by the formatting of the data in the “Context” field in which it matched, the data appears to be the response. Observe the formatting:

karteNummer" value=“6677880000000004” />

This is HTML format, even though it has been truncated. This is most likely part of a field that looks like this:

If this were part of the request, we would see all of the above encoded and in the format of HTTP POST data:

karteNummer=6677880000000004

Or even if the above string were itself a parameter, we would see the encoding:

karteNummer%21%20value%3d%216677880000000004%21%20%2f%3e

Since the “Context” is the ASM showing you precisely where it found the data that caused the match, this indicates that this is exactly the stream it was parsing when the violation was raised.

The data in the “Context” stream came from somewhere, and the fact that the data in the stream looks like HTML rather than HTTP POST data would indicate that this was, in fact, part of the response.

Were it me, I would probably try to connect direct to the web servers and view the source/responses this way to confirm. Alternatively, tcpdumps from the ASM viewing both the browser and server sides simultaneously should show this, as well (assuming this is all plain-text and not SSL).

If the above testing (especially the captures, that would be the most difinitive demonstration) do show that the responses are masked but the ASM stills seems to “see” credit card numbers in them, this is definitely worthy of a case to the folks in F5 Support.

Cheers!

// Ben

I found the reason!

1. One of our developer switched a debug option on, so the values in the POST requests was send back to the browser

2. Why I did not saw it in the response? I searched for the number in the CC number, but DataGuard masked it…

thanks a lot :slight_smile:

bjoern