-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Abilty to include headers in the text for changedetection.io - PCI DSS 11.6.1 Compliance: Detecting Unauthorized HTTP Header Changes with Chrome CDP & Changedetection.io #2943
Comments
This is a fantastic write up, @dgtlmoon! Thank you for raising this enhancement! Looking through the guidance given on PCI DSS 4.0.1 Requirement 11.6.1, I don't actually see any requirement (or mention, really) for logging the headers. I think you have it exactly right‒it only needs to report if there's a change detected on those headers. I'm not sure if something additional needs to be checked for the "indicators of compromise" that is mentioned in this requirement... I'll have to ask our PCI assessor about this and if it would require a separate feature to be implemented in changedetection.io. For compliance, I'm also wondering if we need to provide changedetection.io with what the "authorized" headers for each request would be. Could that be implemented, if needed? |
can you elaborate, or give some technical example? :)
that would be super, please update this thread with what you find out :) |
@hendrickson-tyler readin https://cheq.ai/blog/pci-dss-11-6-1-tamper-header/ , so it talks about that the header check is on the actual payment page, i'm wondering, does it mean you need to add products to a cart and do the checkout etc? actually they have a nice way to solve it with some JS injection |
I think this would be setting something in changedetection.io like: For responses from
And we'd just enumerate the different requests that we expect to make in the page. If it's not in the list, then an alert would be given for that request.
That's correct, the change detection mechanism would essentially fill out the payment form on our side and complete a test payment, monitoring the headers and page contents along the way. Minus the headers, I believe changedetection.io has that functionality already, right? Yeah, there are essentially two methods of implementing this mechanism: agent-less (synthetic/external monitoring, like changedetection.io) or agent-based (embedding a monitoring script, like this CHEQ solution). Each comes with pros and cons. I think a combination of both is ideal, but we're personally looking at agent-less to begin with. Changedetection.io seems so close to being a great solution for this, so we're definitely excited about the potential to monitor for headers 🙂 |
@dgtlmoon This isn't related to the headers, but there's one other piece of the requirement I may have missed. We need to be notified if the contents of the scripts on our payment page have changed:
Essentially, this would just be comparing the response of a GET request against an expected value. Like requests to Is this something achievable with changedetection.io? |
If i understand correctly, you should be able todo this already as a watch with but please not changedetection.io is not going to tell you if there was a network error or the file could not be read, and you should enable "empty pages are a change" option too
changedetection will not scrape those URLs for you from your page (although it could!) |
I see, so to make sure I'm understanding right: There's not really a way to monitor individual requests that the page makes through changedetection.io (maybe beyond the project scope). For example, not a way to say, "when the page makes a GET to Instead, the way to do this would be to separately monitor |
Hmm so you need to monitor all in one 'watch'
this is quickly turning into something else :) can you clarify those last 2? |
We definitely need to monitor the content of JS resources that the page requests. I'm not sure about headers for JS resources... The requirements are very vague. Separately monitoring those URLs for changes with changedetection.io may satisfy this though. Even if the other URLs aren't scraped from the page, I think that should be okay since we'll know them upfront anyway. I think the only problem is if we do need to check contents/headers of multiple resource types on a granular level. For example, monitoring Fetch/XHR POST requests that the page makes would be challenging, I'm sure. If it comes to that, would you see that as out of scope for changedetection.io? Still trying to get some clarification from our QSA on the specifics, but I know he's doing several other evaluations currently. PCI DSS 4.0 is a bit of a mess 😅 |
But any script on your page, if its meant to be "secure" should only be referenced using "Subresource Integrity (SRI), which ensures that only a script with a known checksum is executed. The correct way to do this is by adding the integrity attribute to your <script> tag." ie
|
SRI is a useful way to make sure that the script content hasn't been modified whatsoever. We're personally looking at this for our use case (for requirement 6.4.3), but it's not for everyone. Payment providers often update their scripts, and whenever that happens, it would break the payment page since the script wouldn't execute. So there is some inherent risk, unless mitigated by other means. Even using SRI though, it seems that the requirement to "alert personnel to unauthorized modification ... to the security-impacting HTTP headers and the script contents of payment pages as received by the consumer browser" still applies in 11.6.1. I think because SRI could still be disabled if an attacker was able to change the page content. But I feel pretty confident that setting up a new change detection watch for the scripts themselves should satisfy this part. It's watching the same URL that the payment page requests anyway, so I don't see there being any functional difference. |
hmm also we dont support anything inside <iframe> at the moment, and many payment gateways still embed their content that way |
Luckily for iframes, responsibility for monitoring the scripts falls to the payment provider. I believe all we have to do there is monitor that iframe URL for content/header changes, which seems easy enough to do by setting up another watch |
What ChatGPT says about PCI-DSS-v4_0_1.pdf |
I think #2962 is going to be important here too, it should always trigger notifications/changes against a chosen version rather than just the last checked |
Yeah, I would agree. Pinning a version would be the best way to demonstrate what changes are unauthorized |
@dgtlmoon FYI, sharing a response from the forensics VP of the company we're working with on PCI compliance. I originally stated that the solution would check all response headers, but then clarified it would just check the initial document load (in addition to the headers for the scripts):
It sounds like this is becoming more of an E2E test, rather than a static change detection method. Just curious on your thoughts on the level of effort for the above? Either as part of changedetection.io or some additional integration |
@dgtlmoon Sorry to keep pinging you. A bit of an update on the above. Received this response recently:
We are interpreting this as "checking initial page headers/content do meet the minimum requirements for 11.6.1, but we encourage customers to do more to further avert risk". They have never told us a flat-out "no", so I think the approach with changedetection.io is a valid path to pursue here. 👍 Is header support something you think could be ready in March? Our audit is on March 18, so we're hoping to have some of these loose ends tied up before then. Appreciate all your help on this! |
Adding "reply headers" to the "fetchers" would be amazing, this would be very helpful to a lot of people who want to monitor headers. It wouldnt be so hard..
text_json_diff
processorthe only bit i'm not sure about is "Provide logs of captured request/response headers from a monitoring system.", because it will just check it and only report if something changes?
Here's what chatgpt says
PCI DSS 4.0 (including 4.0.1) compliance requirement 11.6.1 relates to change detection mechanisms for unauthorized modifications to HTTP headers and payment page content. Specifically, it is designed to detect tampering with e-commerce payment pages, which could indicate a Magecart-style attack (where malicious scripts steal cardholder data).
How Request Headers Are Relevant in PCI DSS 11.6.1
The standard itself does not explicitly say, "You must collect and store request headers." However, the intent of 11.6.1 is to ensure that unauthorized changes to the payment page environment (including HTTP request headers and responses) are detected and logged. This is why security auditors may ask to review request headers.
Breakdown of PCI DSS 11.6.1 Requirements
Why Request Headers Matter
Content-Security-Policy
,X-Frame-Options
) is a key control.How to Demonstrate Compliance (for Headers)
Monitoring Solutions:
Evidence Collection:
Testing & Reporting:
Conclusion
The PCI DSS 4.0.1 standard itself does not explicitly require storing request headers, but it requires monitoring for unauthorized changes to HTTP headers and payment pages. If an auditor asks for request headers, they likely want proof that header integrity is being checked as part of compliance with 11.6.1.
Would you like recommendations on tools for automating this monitoring?
For example,
playwright
(pypuppter-ng
), also needs to be handled byrequests
The text was updated successfully, but these errors were encountered: