Secure Code

From a software standpoint one of the key standards that should be met is PA-DSS (Payment Application Data Security Standard), a subset of PCI-DSS. You can read the whole spec here:

I'll copy-and-paste the juicy part here to save you some time:

  • Do not retain full magnetic stripe, card validation, code or value, or PIN block data.
  • Protect stored cardholder data.
  • Provide secure authentication features.
  • Log payment application activity.
  • Develop secure payment applications.
  • Protect wireless transmissions.
  • Test payment applications to address vulnerabilities.
  • Facilitate secure network implementation.
  • Cardholder data must never be stored on a server connected to the internet.
  • Facilitate secure remote software updates.
  • Facilitate secure remote access to payment application.
  • Encrypt sensitive traffic over public networks.
  • Encrypt all non-console administrative access.
  • Maintain instructional documentation and training programs for customers, resellers, and integrators.

Each one of these directives is broken down into further requirements and corresponding tests.

Aside from mastercard's solution, secure code is usually an auditing term within PCI.

PCI 1.2 tells the auditor that they should look for evidence that web application programmers in a PCI environment have had "training for secure coding techniques." This generally means adherence to the OWASP standards.

A1-Injection Injection flaws, such as SQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing unauthorized data.
A2-Cross Site Scripting (XSS) XSS flaws occur whenever an application takes untrusted data and sends it to a web browser without proper validation and escaping. XSS allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
A3-Broken Authentication and Session Management
A4-Insecure Direct Object References A4-Insecure Direct Object References A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. Without an access control check or other protection, attackers can manipulate these references to access unauthorized data.
A5-Cross Site Request Forgery (CSRF) A CSRF attack forces a logged-on victim’s browser to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application. This allows the attacker to force the victim’s browser to generate requests the vulnerable application thinks are legitimate requests from the victim.
A6-Security Misconfiguration Good security requires having a secure configuration defined and deployed for the application, frameworks, application server, web server, database server, and platform. All these settings should be defined, implemented, and maintained as many are not shipped with secure defaults. This includes keeping all software up to date, including all code libraries used by the application.
A7-Insecure Cryptographic Storage Many web applications do not properly protect sensitive data, such as credit cards, SSNs, and authentication credentials, with appropriate encryption or hashing. Attackers may steal or modify such weakly protected data to conduct identity theft, credit card fraud, or other crimes.
A8-Failure to Restrict URL Access Many web applications check URL access rights before rendering protected links and buttons. However, applications need to perform similar access control checks each time these pages are accessed, or attackers will be able to forge URLs to access these hidden pages anyway.
A9-Insufficient Transport Layer Protection Applications frequently fail to authenticate, encrypt, and protect the confidentiality and integrity of sensitive network traffic. When they do, they sometimes support weak algorithms, use expired or invalid certificates, or do not use them correctly.
A10-Unvalidated Redirects and Forwards
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License