Medium severityC#Sensitive Data ExposureMEDIUM confidence
Hardcoded Credit Card Literal
A value that matches a real credit-card number (Visa/MC/Amex/Discover) is hard-coded in source (CWE-312).
Standards mapping
Vulnerable vs. safe
Flagged by this check
var cardNumber = "4111111111111111";Passes - the safe pattern
var cardLast4 = "1111";Why it matters & how to fix it
A value that matches a real credit-card number (Visa/MC/Amex/Discover) is hard-coded in source (CWE-312). Cardholder data in code violates PCI-DSS and leaks through source control. Remove it, use documented test-card numbers in tests only, and never persist PANs in cleartext.
References
Rule ID integsec.csharp.sensitive-data.hardcoded-credit-card-literal - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Sensitive Data ExposureError Stack In Response
- JavaScript / TypeScript - Sensitive Data ExposurePII PHI In Logs
- JavaScript / TypeScript - Sensitive Data ExposureSecret In Logs
- JavaScript / TypeScript - Sensitive Data ExposureSensitive Data Client Storage
- JavaScript / TypeScript - Sensitive Data ExposureSensitive Data In URL Query
- Python - Sensitive Data ExposureFlask Traceback In Response