Technical information leak
Description
It is possible to obtain technical information such as:
- System component versions (HTTP headers, service banner, etc.)
- Specific information about the configuration of server components (php.ini, web.config)
Impact
Obtain technical information to create new attack vectors.
Recommendation
- Eliminate the services banner with information leakage.
- Verify that HTTP headers do not display any name or version.
Threat
Anonymous attacker from the Internet.
Expected Remediation Time
⌚ 60 minutes.
Score
Default score using CVSS 3.1. It may change depending on the context of the vulnerability.
Base
- Attack vector: N
- Attack complexity: L
- Privileges required: N
- User interaction: N
- Scope: U
- Confidentiality: L
- Integrity: N
- Availability: N
Temporal
- Exploit code madurity: U
- Remediation level: U
- Report confidence: C
Result
- Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:U/RL:U/RC:C
- Score:
- Base: 5.3
- Temporal: 4.9
- Severity:
- Base: Medium
- Temporal: Medium
Code Examples
Compliant code
Avoid the use of those functions in a production environment
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class Test {
private static Logger logger = LogManager.getLogger(Log4jExample.class);
public static void main(String[ ] args) {
try {
int[] myNumbers = {1, 2, 3};
System.out.println(myNumbers[10]);
} catch (IndexException e) {
if (e.toString() == "Error"){
System.out.println("Error");
}
}
}
}
Non compliant code
The system potentially exposes technical information through the use of functions like printStackTrace
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class Test {
private static Logger logger = LogManager.getLogger(Log4jExample.class);
public static void main(String[ ] args) {
try {
int[] myNumbers = {1, 2, 3};
System.out.println(myNumbers[10]);
} catch (IndexException e) {
if (e.toString() == "Error"){
System.out.println("Error");
}
e.printStackTrace();
}
}
}
Requirements
free trial
Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.