Skip to main content
ContentHigh PriorityPro

PII Disclosure

Updated November 2026·SecScanner Team

PII (Personally Identifiable Information) disclosure occurs when sensitive data like credit card numbers or social security numbers appear in page content.

Results in 1–3 minutes · Free · No signup required

Why It Matters

Exposed PII violates privacy regulations (GDPR, PCI-DSS, CCPA), can lead to identity theft and financial fraud, and exposes your organization to significant legal liability.

How We Check

We scan page content for credit card number patterns (with Luhn validation) and Social Security Number formats. Analysis is limited to the first 200KB of content.

Good vs Bad Values

Good and bad values for PII Disclosure
ValueVerdictWhy
No card-like or SSN-like strings in the first 200 KB of HTMLGoodThe check passes. It does not look for emails or phone numbers.
Card shown as •••• •••• •••• 1111GoodMasked display with the last four digits. PCI DSS allows at most the first six and last four digits to be shown.
Order reference 20240318-4471GoodNot a card pattern and not formatted as three-two-four digits. Not reported.
4111111111111111 (16 digits, Luhn-valid) in the HTML or an inline JSON blobBadA full card number. Visa, Mastercard, Amex, Discover and Diners prefixes are matched and the digits must pass the Luhn check.
123-45-6789 or 123 45 6789BadA US Social Security Number layout with dashes or spaces. Ranges that are never issued (000, 666, 9xx) are excluded.
__NEXT_DATA__ containing a full customer recordBadServer-rendered props are written into the page. A field you did not mean to show is still delivered to every visitor of that page.
A 16-digit tracking or invoice number that passes LuhnWeakAbout one in ten random digit strings passes the checksum, so long numeric identifiers can be flagged by chance. Confirm what the value is before reporting it as a leak.
9-digit number with no dashes or spacesGoodThe SSN pattern needs separators, so a bare run of digits is not matched.

How to Fix

Implement server-side data masking for all displayed PII. Use tokenization for payment data. Apply data loss prevention (DLP) controls. Never store or display full credit card numbers in HTML.

Select fields explicitly in the data layer so a new column cannot leak by accident:

const user = await prisma.user.findUnique({
  where: { id },
  select: { id: true, name: true, plan: true },   // not the whole row
});

Mask before rendering and keep the full value server-side:

export const maskCard = (pan: string) => '•••• •••• •••• ' + pan.replace(/\D/g, '').slice(-4);
export const maskSsn = (ssn: string) => '•••-••-' + ssn.replace(/\D/g, '').slice(-4);

Do not handle card numbers yourself. Use hosted fields from your payment provider (for example Stripe Elements) so the number goes from the browser to the provider and never touches your pages or servers; store only the token.

Next.js — in the Pages Router, return only the fields you need from getServerSideProps; in the App Router, pass narrow props from server components to client components, since client props are serialised into the page. WordPress — check plugins that print user or order data into the page footer or a JavaScript object.

Add a safety net in CI so a regression is caught before release:

# fail the build if a built page contains an SSN-like string
if grep -rEn '\b[0-9]{3}-[0-9]{2}-[0-9]{4}\b' out/ 2>/dev/null; then exit 1; fi

Verify by viewing the page source (not the rendered page) and searching for the field names and values that should never appear. If one was published, remove it, purge the cache and CDN copy, and assess whether a breach notification duty applies in your jurisdiction.

Common Mistakes

  • Passing a full database row to a template or to getServerSideProps and relying on the template to show only some columns. Everything in the props is in the HTML.
  • Printing the card number on a receipt page or in a confirmation email's web view instead of the last four digits.
  • Leaving test data on a production page, such as a demo account with a real-looking number.
  • Putting personal data in URLs and canonical tags. It then appears in markup, logs and the Referer header.
  • Assuming a login wall protects it. A cached copy, a shared link, or a search crawler can still deliver the page.

Frequently Asked Questions

What is PII Disclosure?

PII (Personally Identifiable Information) disclosure occurs when sensitive data like credit card numbers or social security numbers appear in page content.

Why does PII Disclosure matter for website security?

Exposed PII violates privacy regulations (GDPR, PCI-DSS, CCPA), can lead to identity theft and financial fraud, and exposes your organization to significant legal liability.

How do I fix PII Disclosure issues?

Implement server-side data masking for all displayed PII. Use tokenization for payment data. Apply data loss prevention (DLP) controls. Never store or display full credit card numbers in HTML.

Related Security Checks

Check Your Website Now

Run a free security scan to check for PII Disclosure issues and 61 other security checks.

Scan Your Website Free