Data Validation & Encoding (VE2)

DATA VALIDATION & ENCODING
2

O Brian pode reunir informação acerca das configurações subjacentes, esquemas, lógica, código, software, serviços e infraestrutura devido ao conteúdo das mensagens de erro, ou configuração deficiente, ou da presença de ficheiros de instalação padrão ou antigos testes, cópias de segurança, cópias de recursos ou à exposição de código-fonte

How to play?

The key concept is that verbose error messages, misconfigurations, and leftover or exposed files/code can leak internal system details, enabling attackers to discover and exploit your application. See also Authentication 7 relating to different messages at the user login page to indicate that the username or the password are wrong.

Scenario: Brian’s Discovery

Imagine a situation where Brian, a potential intruder, learns about your system’s configurations, logic, and infrastructure. He does this through error messages or misconfigurations on your website. This can happen in several ways:

  1. Detailed Error Messages: Error messages that inadvertently reveal software types, database structures, or even source code.
  2. Default or Outdated Files: The presence of unmodified default configurations or old, test, backup files left on the server.
  3. Exposed Source Code: Situations where the source code is accidentally made visible on the website.

Example

Brian attacks by accessing a server error page that is poorly configured. Instead of a generic error message, it displays detailed database error information, including software versions and file paths. This error message becomes a treasure trove of information for Brian, allowing him to identify specific vulnerabilities for targeted attacks.

Threat Modeling

STRIDE

The situation falls under the Information Disclosure category in the STRIDE threat modeling framework. Verbose error messages, default files, backup/test copies, exposed source code all give attackers extra visibility into the system’s inner workings, the risk is therefor Information Disclosure.

What can go wrong?

This kind of information leakage can lead to targeted attacks, exploitation of system vulnerabilities, and significant security breaches.

Many web applications (and other base software) usually provide error messages with information about the nature of the error by default. This is most useful to the developer, as it helps to identify where the error is happening and why. The default configuration also sometimes provides some admin functions to ease their learning curve. However, if this default behaviour is not changed in non-development environments, users (and attackers) can profit from it to acquire knowledge about the internal workings of the application and supporting systems/components.

Other sources of information disclosure are often generated by the developer. These range from messages for internal use, and are not removed when deployed in production, to simple bad programming practices. Some examples of these are:

  1. Exposing sensitive information (such as session identifiers, variables references, login data, etc.) in HTTP headers, URLs, custom error messages, comments, logs, related email messages, etc.
  2. Including server-side source code in outputs accessible by users.
  3. Including sensitive comments in outputs accessible by users.
  4. Allowing user access to configuration files.
  5. Leaving default install, unused or old files in web accessible locations.
  6. Revealing the application file structure (path to files in error messages or misuse of the robots.txt file).
  7. Giving hints about the application workflow and/or security checks as user friendly messages.

For more things that can go wrong, see the Common Attack Patterns related to this card in the table below.

What are we going to do about it?

  1. Implement generic, non-revealing error messages.
  2. Ensure system configurations are secure and default installation files are removed or updated.
  3. Regularly audit and clean up any old, test, or backup files.
  4. Keep source code strictly protected from public exposure.

For detailed advice on how to mitigate threats related to the card, see the ASVS and OWASP Developer Guide requirements in the table below.

Mappings

STRIDE: Information Disclosure

OWASP ASVS: 2.4.1,4.3.2,13.2.2,13.4.1,13.4.2,13.4.3,13.4.4,13.4.5,13.4.6,13.4.7,15.2.3,16.2.5,16.3.4,16.4.2,16.5.1,17.1.1

CAPEC: 54,113,116,143,144,149,150,155,169,215,224,497,541,546

OWASP DevGuide: SC1,SC2,SC3,SC4,SC8,SC9,SC10,SC11,SC12,SC13,FM1,FM2,FM5,EE6,EE7,EE8

SAFECode: 4,23

CAPEC™ Map

CodeTitleASVS
54Query System for Information
116Excavation
143Detect Unpublicized Web Pages
144Detect Unpublicized Web Services
149Explore for Predictable Temporary File Names
150Collect Data from Common Resource Locations
155Screen Temporary Files for Sensitive Information
169Footprinting
215Fuzzing for application mapping
224Fingerprinting
497File Discovery
541Application Fingerprinting
546Incomplete Data Deletion in a Multi-Tenant Environment

ASVS (5.0) Cheat Sheet Series Index

Attacks

Error message exploitation

OWASP Cornucopia

OWASP Cornucopia is a mechanism in the form of a card game to assist software development teams identify security requirements in Agile, conventional and formal development processes. It is language, platform and technology-agnostic, and is free to use. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 4.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar licence to this one.

© 2012-2025 OWASP Foundation. The Open Worldwide Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.