Blog

5 Steps to Audit Payment Forms for PCI DSS Compliance

By
The Reform Team
Use AI to summarize text or ask questions

If your business processes credit card payments online, meeting PCI DSS standards is non-negotiable. PCI DSS v4.0, effective as of March 31, 2025, introduces stricter requirements to address client-side threats like Magecart and e-skimming. Non-compliance risks hefty fines ranging from $5,000 to $100,000 monthly, with data breaches averaging $6.08 million in costs.

To comply, follow these five steps:

  1. Inventory Payment Form Scripts: Catalog all scripts on payment pages, including third-party and conditional scripts. Document their source, purpose, and business justification.
  2. Verify Authorization and Integrity: Ensure all scripts are approved and protected using tools like Content Security Policies (CSP) and Subresource Integrity (SRI). Set up monitoring for unauthorized changes.
  3. Map Your Cardholder Data Environment (CDE): Diagram how cardholder data flows through your systems, isolate sensitive environments, and use tokenization to reduce compliance scope.
  4. Implement Tamper Detection and Alerts: Use tools to monitor and alert for changes in payment page scripts and HTTP headers, with weekly or real-time checks based on risk.
  5. Document and Report Compliance: Maintain detailed records of findings, remediation efforts, and audit results. Complete the required Self-Assessment Questionnaire (SAQ) and Attestation of Compliance (AOC).
5-Step PCI DSS Payment Form Audit Process

5-Step PCI DSS Payment Form Audit Process

Understanding PCI DSS Compliance | Centraleyes

PCI DSS

Step 1: Create an Inventory of All Payment Form Scripts

The first step in a PCI DSS 4.0 audit is to pinpoint exactly what scripts are running on your payment pages. This means cataloging every script, including your own code and third-party tools. On average, a typical website has 50 to 100 scripts running in the background, and about 20% to 30% of these come from fourth-party domains - scripts loaded by your vendors without explicit approval. These "shadow scripts" can introduce vulnerabilities, making a complete inventory essential for setting up proper authorization and integrity controls.

Start by using browser developer tools (DevTools). Open a payment page, press F12, and go to the Network tab. Filter for "JS" to see all JavaScript files being requested as the page loads. Then, check the Sources tab to identify external domains. This process helps uncover what’s actively running during a payment session. However, DevTools only show scripts loaded during that specific session. Conditional scripts - those triggered by region, device type, user segments, or experiments - might not appear in a single audit.

This is why multiple audits are necessary. Test across different browsers, incognito modes, and VPNs to expose hidden or conditional scripts. Pay close attention to scripts that load additional dependencies, as these fourth-party chains often lack documentation. Make sure to identify any scripts interacting with sensitive elements, like credit card fields.

For every script, document the following details:

  • Source URL
  • Functional purpose (e.g., analytics, fraud detection, payment processing)
  • Business justification
  • Assigned owner

This level of detail is required by PCI DSS 6.4.3. If a script cannot be tied to a clear business purpose, it has no place on your payment page. Be prepared: manually tracking scripts can take 6–8 hours per page. For 50 payment pages, you’re looking at 300–400 hours of work. While time-intensive, documenting the purpose and ownership of each script is critical for compliance. Once your inventory is complete, the next step is to confirm that all scripts are authorized and integrity-checked.

Step 2: Check Script Authorization and Integrity Controls

After creating a complete inventory, the next step is ensuring that every script is both authorized and protected from tampering. According to PCI DSS 6.4.3, each script must have a documented business or technical justification, along with proof of approval before it’s deployed. You can manage this by using repository-based systems to compare production scripts with an approved list or by implementing change management workflows that require multiple reviewers for added oversight. Once authorization is in place, enforce it with technical controls.

A Content Security Policy (CSP) serves as a technical safeguard by acting as a whitelist that limits script execution to specific domains. A good starting point is to use a "default-deny" policy, explicitly allowing trusted sources like *.adyen.com or pay.google.com. However, while a CSP can restrict where scripts run, it doesn’t verify the integrity of the scripts themselves. To refine your CSP, begin in "report-only" mode to log unauthorized script activity. Once you’ve verified all authorized sources, switch to a blocking policy.

For static scripts, implement Subresource Integrity (SRI) using cryptographic hashes (e.g., SHA-384) to ensure the script hasn’t been altered. For dynamic scripts, use behavioral monitoring to detect any unauthorized actions.

Managing dynamic payment pages presents unique challenges. Third-party vendors may update scripts outside of your standard deployment process, leading to a "script drift" from the approved version. To address this, introduce a multi-stage approval process that includes input from security, business, and privacy teams. Additionally, PCI DSS 11.6.1 mandates real-time detection of script changes and immediate alerts to security personnel. These measures should also extend to the parent page to safeguard embedded payment iframes.

Finally, remember to review not just the payment form but also its parent page. Even if the iframe is secure, scripts on the parent page can still access or interfere with the payment process, posing a significant risk.

Step 3: Map Your Cardholder Data Environment

After verifying script integrity, the next step is to pinpoint exactly where cardholder data (CHD) resides and moves within your organization. Your Cardholder Data Environment (CDE) includes all systems that store, process, or transmit CHD or sensitive authentication data (SAD). This can encompass web servers, payment applications, databases, payment gateways, and the security systems that support them. To ensure clarity, document how data flows through all your payment channels.

This mapping process is crucial for your PCI DSS audit, as it highlights potential data exposure points. Start by creating detailed data flow diagrams for every payment channel you use - whether it’s online, over the phone, or in person. Track CHD from the moment it enters your system to the point it exits. Pay special attention to payment forms, tracing the data journey from the customer’s browser through your web server and on to the payment gateway. Don’t overlook hidden storage locations like backups, logs, swap files, or recordings, which might inadvertently store CHD.

Network segmentation plays a key role in reducing both compliance scope and costs. By isolating the CDE from your broader corporate network using firewalls and VLANs, you can significantly limit the systems subject to strict PCI DSS controls. Additionally, implementing tokenization can cut compliance costs by as much as 70% to 90% by eliminating the need to store the Primary Account Number (PAN) in your environment. To ensure your segmentation strategy is effective, schedule annual penetration tests to verify that systems outside the CDE remain securely isolated.

Properly mapping your environment also helps determine which Self-Assessment Questionnaire (SAQ) applies to your business. For instance, if you fully outsource payment processing and redirect customers to a third-party payment page, you might qualify for SAQ A, which has only 22 questions. On the other hand, embedding headless payment forms on your site via iframes or JavaScript requires SAQ A-EP, which includes 178 questions. Businesses that store card data or process it directly on their servers must complete SAQ D, which involves 329 questions. The difference between a $15,000 audit and a $150,000 audit often depends on how effectively you’ve scoped and segmented your environment.

Under PCI DSS 4.0.1 Requirement 12.5.2, you’re required to perform a documented scoping exercise annually - or semi-annually if you’re a service provider - to keep your data flow diagrams up to date. Outdated documentation is a common cause of audit failures. As QSA Thomas McCrory points out:

Maintain an accurate network diagram. I often see diagrams that represent a PCI compliant network, but actual network configurations usually reflect otherwise.

Step 4: Set Up Tampering Detection and Alerts

Once you've mapped out your cardholder data environment, the next step is to deploy tamper-detection systems. These systems are designed to immediately flag unauthorized changes in HTTP headers and payment page scripts. According to PCI DSS Requirement 11.6.1, organizations must implement a change- and tamper-detection mechanism that alerts personnel to any unauthorized modifications in HTTP headers and payment page scripts as they appear in a consumer's browser. This requirement becomes mandatory starting March 31, 2025. Understanding this is key to addressing how modern attacks bypass server-side defenses.

Traditional server-side file monitoring falls short against newer threats. Attacks like Magecart-style intrusions inject malicious code directly into the browser during runtime by exploiting third-party scripts or tag managers. This vulnerability highlights the importance of PCI DSS 11.6.1's focus on in-browser tamper detection. As stated in the PCI DSS Guidance:

The only place to detect changes or indicators of malicious activity is in the consumer browser as the page is constructed and all JavaScript interpreted.

To build an effective detection strategy, use a combination of tools. For instance, a Content Security Policy (CSP) with reporting directives can alert you when scripts from unauthorized domains attempt to run. Meanwhile, Subresource Integrity (SRI) uses cryptographic hashes to block modified scripts automatically. These techniques work hand-in-hand with the alert systems described below.

Configure alerts to notify your team immediately via email, SMS, Slack, Teams, or webhooks. These alerts should include forensic details, such as which script was altered and where data was sent, to streamline investigations. To avoid unnecessary noise, you can apply ignore filters for non-critical areas, like marketing banners. Most importantly, integrate these alerts into your Incident Response Plan to ensure your team is ready to act when tampering is detected.

The frequency of monitoring should align with your risk level. While the minimum requirement is weekly checks, high-traffic e-commerce sites may need daily or even real-time monitoring. If you choose to monitor less frequently than once a week, document your decision with a Targeted Risk Analysis (TRA). Considering the 300% rise in payment page skimming incidents and the average breach detection time of 212 days, increasing your monitoring frequency can dramatically reduce your vulnerability window.

Step 5: Document Results, Fix Issues, and Complete Reporting

Once tamper detection is set up, it's time to formalize your audit findings. Start by compiling an audit report that not only proves compliance but also guides remediation efforts. Each PCI DSS requirement should be classified as "In Place", "Not in Place", "Not Applicable," or "Not Tested". For any item marked "Not in Place", document the gap, detail the necessary remediation steps, and provide a timeline for completion.

Your report should include all required elements to demonstrate compliance. This means maintaining an up-to-date asset inventory that includes all software, infrastructure, and scripts within your cardholder data environment. For Requirement 6.4.3, include a comprehensive script inventory, along with justifications for each script, authorization records, and your methodology for integrity validation. Similarly, for Requirement 11.6.1, provide details about your automated monitoring solution, sample alerts to showcase detection capabilities, and documented response protocols. As Ivan Tsarynny, CEO of Feroot, aptly puts it:

This is how auditors see it: if something is not documented, it didn't happen.

The next step is to act on these findings immediately. Address compliance gaps using the "Prioritized Approach" methodology, which sequences remediation tasks based on risk. This ensures that the most critical vulnerabilities are addressed first. Keep in mind that manual compliance efforts typically require 160–200 hours annually, costing around $35,000 in labor. By automating the process, you can cut this down to 30–60 hours, with total costs averaging $45,000. Additionally, organizations with tested incident response plans tend to save significantly in breach costs, averaging $3.26 million compared to $5.29 million for those without - a difference of $2.03 million.

After completing remediation, you’ll need to fill out the appropriate Self-Assessment Questionnaire (SAQ). Using tools like Reform can simplify this process by outsourcing payment form security, which reduces your audit scope and eliminates the need for complex client-side controls. Reform handles encrypted submissions and integrates securely with PCI-compliant payment processors, allowing you to focus on your business instead of drowning in compliance paperwork.

Finally, wrap up your compliance process by completing the Attestation of Compliance (AOC). This official form documents your compliance status and must be signed by an authorized representative or a Qualified Security Assessor (QSA). If required, include passing scan reports from an Approved Scanning Vendor (ASV) in your submission. Submit the AOC and all supporting documentation to your acquiring bank by the deadline.

Conclusion

Auditing payment forms for PCI DSS compliance isn’t just a one-time task - it’s a continuous effort to protect both your customers and your business. The five-step process outlined here provides a straightforward way to tackle vulnerabilities that traditional server-side measures might miss. These steps - creating a script inventory, verifying authorization and integrity, mapping your cardholder data environment, setting up real-time tamper detection, and documenting findings - are especially important in combating client-side threats like formjacking, which affected over 11,000 e-commerce domains in 2024.

The stakes are high. Non-compliance can cost businesses between $5,000 and $100,000 per month, and the average cost of a data breach sits at $6.08 million, not to mention the damage to customer trust. As Rui Ribeiro, CEO of Jscrambler, emphasizes:

Achieving compliance is vital to their long-term success, and businesses must act now by securing payment pages, detecting unauthorized modifications, and protecting customer data.

Automation can ease the burden significantly. While manual compliance efforts might take 160 to 200 hours annually and cost around $35,000, automated solutions can reduce that to just 30 to 60 hours. Reform, for instance, simplifies compliance with hosted payment fields and tokenization, keeping sensitive card data off your servers. This approach minimizes your audit scope and reduces the need for complex client-side monitoring, freeing you to focus on growing your business instead of drowning in compliance tasks. By implementing these measures, you can secure your payment forms and maintain PCI DSS compliance with confidence.

FAQs

What changes in PCI DSS v4.0 affect payment pages?

The latest PCI DSS v4.0 introduces two key requirements - 6.4.3 and 11.6.1 - that focus on mitigating client-side risks on payment pages. These updates are designed to ensure tighter control and monitoring of scripts used during online transactions.

  • Requirement 6.4.3 emphasizes managing scripts that are active on payment pages, ensuring they are authorized and safe to use.
  • Requirement 11.6.1 focuses on detecting unauthorized changes to scripts or HTTP headers, which could compromise sensitive payment data.

Together, these measures aim to strengthen security protocols and safeguard customer information during online payments.

How do I find “shadow” and conditional scripts on my checkout?

To spot shadow and conditional scripts on your checkout pages, start by auditing your payment pages for any unauthorized or harmful code. Keep a detailed inventory of all scripts - whether they’re first-party, third-party, or even fourth-party - and make it a habit to regularly check their integrity.

Leverage script monitoring tools to catch unauthorized or altered scripts as they appear in real-time. On top of that, dive into your source code and conduct thorough audits to identify hidden or dynamically loaded scripts that might otherwise go unnoticed.

Do I need real-time tamper detection for compliance?

Yes, real-time tamper detection is a requirement for PCI DSS v4.0 compliance, specifically under section 11.6.1. This involves deploying tools or mechanisms that can identify unauthorized changes made to payment pages as they appear in the consumer's browser. These measures are critical for safeguarding cardholder data, as they help detect and alert businesses to tampering during online transactions, ensuring both compliance and enhanced security.

Related Blog Posts

Use AI to summarize text or ask questions

Discover proven form optimizations that drive real results for B2B, Lead/Demand Generation, and SaaS companies.

Lead Conversion Playbook

Get new content delivered straight to your inbox

By clicking Sign Up you're confirming that you agree with our Terms and Conditions.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
The Playbook

Drive real results with form optimizations

Tested across hundreds of experiments, our strategies deliver a 215% lift in qualified leads for B2B and SaaS companies.