This vulnerability occurs when an application accepts user input as a resource identifier (like a file path or port number) without proper validation, allowing an attacker to access or manipulate resources outside the intended scope.
A resource injection flaw arises when two conditions are met. First, an attacker can control the identifier used to access a system resource, such as part of a filename, a database key, a network port, or a configuration setting. Second, by controlling this identifier, the attacker gains unauthorized capabilities—like reading sensitive files, overwriting protected data, redirecting network traffic, or altering application behavior—that would normally be restricted. In practice, this happens because the application treats unvalidated user input as a direct reference to a resource. For example, an attacker might supply a path like '../../etc/passwd' to traverse directories, or specify a remote server address to exfiltrate data. The core failure is a lack of input validation and authorization checks before the resource is accessed, effectively letting users dictate which system resources the application uses.
Impact: Read Application DataModify Application DataRead Files or DirectoriesModify Files or Directories
An attacker could gain access to or modify sensitive data or system resources. This could allow access to protected files or directories including configuration files and files containing sensitive information.
Strategy: Input Validation
javac++High