Skip to main content

Technical information leak - Print Functions

Description

Technical information is obtained from the application due to the use of print functions (Print, PrinStackTrace, Println, among others) whose outputs are normally shown in the stdout (standard output). In development environment it is acceptable to use these functions to see errors (Debug), but using them in production environment is the same as exposing yourself to show sensitive information of the application.

Impact

  • Enlarge attack surface.
  • Access to technical information of the application.

Recommendation

The application must securely report all possible events that may occur, it must not provide technical or sensitive information to unauthorized users, as they could exploit it to extend the knowledge of the attack surface.

Threat

Authenticated local attacker with access to the server console.

Expected Remediation Time

⌚ 15 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: L
  • Attack complexity: L
  • Privileges required: H
  • User interaction: N
  • Scope: U
  • Confidentiality: L
  • Integrity: N
  • Availability: N

Temporal

  • Exploit code madurity: P
  • Remediation level: U
  • Report confidence: C

Result

  • Vector string: CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N/E:P/RL:U/RC:C
  • Score:
    • Base: 2.3
    • Temporal: 2.2
  • Severity:
    • Base: Low
    • Temporal: Low

Code Examples

Compliant code

The application does not make use of any printing functions

public class Test{
public static void main(String[] args){
try {
throw new IOException();
}
catch (IOException e) {
//Code to handle the exception
}
}
}

Non compliant code

The source code contains printing functions that could potentially disclose sensitive information

public class Test{
public static void main(String[] args){
try {
throw new IOException();
}
catch (IOException e) {
e.printStackTrace();
}
}
}

Requirements