Skip to main content

PCI DSS 6.2.4: the six attack classes, how each shows up in code, and the evidence assessors want

PCI DSS 4.0 requirement 6.2.4 is one sentence followed by a list. The sentence asks that software engineering techniques or other methods are defined and in use by developers to prevent or mitigate common software attacks in bespoke and custom software. The list names six attack classes. It pays to know what each item means in code and how to show the method is in use, not just written down.

We covered requirement 6 as a whole (code review in 6.2.3, the inventory in 6.3.2, what scanning can and cannot evidence) in PCI DSS 4.0 requirement 6 and code review evidence. This post goes one level deeper on 6.2.4 only. The wording below follows PCI DSS v4.0.1, which kept the requirement as it was in v4.0.

The six classes, as the standard lists them

6.2.4 says "including but not limited to" these:

  1. Injection attacks: SQL, LDAP, XPath, or other command, parameter, object, fault or injection-type flaws.
  2. Attacks on data and data structures: attempts to manipulate buffers, pointers, input data or shared data.
  3. Attacks on cryptography usage: weak, insecure or inappropriate implementations, algorithms, cipher suites or modes of operation.
  4. Attacks on business logic: abusing or bypassing application features through APIs, protocols, client-side functionality or other functions. The standard puts cross-site scripting (XSS) and cross-site request forgery (CSRF) here.
  5. Attacks on access control mechanisms: bypassing or abusing identification, authentication or authorization, or exploiting weaknesses in how they are implemented.
  6. Attacks via any "high-risk" vulnerability identified under requirement 6.3.1.

The "not limited to" matters. The list is a floor, so your method should name the classes relevant to your stack, and these six at minimum.

1. Injection

The standard names SQL, LDAP and XPath explicitly, and teams that only check SQL miss the other two. A Java directory lookup is a typical LDAP case:

// Vulnerable: the username becomes part of the LDAP filter
String filter = "(uid=" + request.getParameter("user") + ")";
NamingEnumeration<SearchResult> r = ctx.search("ou=people,dc=example,dc=com", filter, controls);
// Fixed: a filter argument, which the directory API escapes
String filter = "(uid={0})";
NamingEnumeration<SearchResult> r = ctx.search("ou=people,dc=example,dc=com", filter,
        new Object[] { request.getParameter("user") }, controls);

The same shape applies to OS commands, NoSQL operators, template engines and expression languages: parameterise, or validate against an allow list before the value reaches the interpreter.

2. Attacks on data and data structures

In C and C++ this is memory safety: unbounded copies, format strings, integer overflow in an allocation size, use after free. A payment terminal integration or a native library in your stack is in scope if it is bespoke.

/* Vulnerable: no bound on the copy */
char name[64];
strcpy(name, input);
/* Fixed: bounded, always terminated */
char name[64];
snprintf(name, sizeof name, "%s", input);

In managed languages the same item covers manipulated input data: unsafe deserialization of client-supplied objects, and mass assignment where a request body sets fields such as amount or role that it should never control.

3. Attacks on cryptography usage

Weak algorithms and modes are the obvious cases: MD5 or SHA-1 for passwords, DES or RC4, AES in ECB mode, a static IV, Math.random() for a token, certificate verification turned off in an HTTPS client.

# Vulnerable: ECB leaks patterns, and the key is in the source
cipher = AES.new(b"0123456789abcdef", AES.MODE_ECB)
# Fixed: authenticated encryption, a fresh nonce, the key from a key manager
key = kms_client.get_data_key()
cipher = AES.new(key, AES.MODE_GCM)
ciphertext, tag = cipher.encrypt_and_digest(data)

Key management itself (requirement 3) is out of scope for 6.2.4, but a hardcoded key in code is both.

4. Attacks on business logic

This is the broadest item. In code it often looks like trusting the client: a price, a discount or a quantity limit enforced only in the browser, a checkout step that can be skipped by calling the next API directly, or a refund endpoint with no limit on how often it runs.

// Vulnerable: the client decides what the order costs
app.post("/checkout", requireLogin, async (req, res) => {
  await charge(req.user, req.body.total);
});
// Fixed: the server prices the cart it already holds
app.post("/checkout", requireLogin, async (req, res) => {
  const cart = await carts.forUser(req.user.id);
  await charge(req.user, priceCart(cart));
});

Because the standard places XSS and CSRF under this item, unescaped output and state-changing routes without CSRF protection belong in your evidence for item 4, not only in a separate web checklist.

5. Attacks on access control

Missing authentication on a route, a missing ownership check on an object id (IDOR), a role check done in the UI only, or a JWT accepted without verifying its signature. These are hard for pattern matching and easy to get wrong, which is why we wrote about broken access control separately. Evidence here should show which routes have authentication and authorization, not only that a scan ran.

6. High-risk vulnerabilities from 6.3.1

6.3.1 is your process for identifying and ranking vulnerabilities, including in third-party components. Item 6 ties the two together: once something is ranked high-risk, 6.2.4 expects development practices to prevent it. A dependency with a published advisory that your code actually calls is the common case.

What evidence an assessor can check

6.2.4 asks for methods that are "defined and in use". That suggests two kinds of evidence:

  • Defined: your secure coding standard names each of the six classes, how it is prevented in your stack (parameterised queries, output encoding, approved crypto library, server-side pricing, central authorization), and which tool or review step checks it.
  • In use: records that the check ran on real changes. Scan results per pull request, with the rule that fired, the file and line, and what happened next (fixed, accepted with approval, false positive with a reason).

Mapping the six classes with Vulkro

Vulkro Core reports findings with rule IDs you can put in that table. For example, in Java JAVA-SQLI-001, JAVA-LDAP-001 and JAVA-XPATH-001 cover item 1 and JAVA-CRYPTO-001 item 3; in PHP PHP-LDAPX-001 covers LDAP and XPath and PHP-XSS-001 covers XSS; in C, C-BAN-001 and C-ALLOC-001 cover item 2. Dependency findings cover item 6.

vulkro compliance . --profile pci
vulkro compliance-pack . --framework pci-dss-4-0 -o pci-evidence/
vulkro gate --base origin/main

The evidence pack writes a findings CSV with file and line and a pci-dss-4-0.html table linking each control to the rule IDs behind it. Running vulkro gate in the pull request pipeline gives you the "in use" record: every change is checked, and only findings it introduced fail it. Access-control classes such as object-level authorization are reported as Not checked when Vulkro cannot decide them offline, which tells the assessor exactly where manual review still applies.

FAQ

What does PCI DSS 6.2.4 require?

That developers define and use techniques to prevent or mitigate common attacks on bespoke and custom software, including at least injection, attacks on data and data structures, cryptography misuse, business logic abuse (including XSS and CSRF), access control attacks, and high-risk vulnerabilities found under 6.3.1.

Does PCI DSS 6.2.4 require a SAST tool?

No tool is mandated. The requirement accepts "software engineering techniques or other methods". Automated scanning is a practical way to show a method is in use on every change, alongside a written standard and code review.

Where do XSS and CSRF fit in PCI DSS 4.0?

In 6.2.4 they are named under attacks on business logic. In the older v3.2.1 they had their own sub-requirements in 6.5, which is why many checklists still list them separately.

See the PCI DSS reference and the compliance evidence use case, or start a 14-day trial. Related: taint analysis: sources, sinks and sanitizers.