Skip to main content

Insecure service configuration - Host verification


The system does not properly restrict incoming conections from unknown external hosts.


Establish conections with untrusted machines.


Validate that incoming conections come from trusted hosts already defined in the known_hosts file.


Authenticated attacker from the Internet.

Expected Remediation Time

⌚ 15 minutes.


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


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


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


  • Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N/E:P/RL:O/RC:C
  • Score:
    • Base: 5.4
    • Temporal: 4.9
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

Only if the application must allow connections to insecure hosts for legacy reasons, these should be specified in the subdomains

<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true"></domain>
<domain includeSubdomains="true"></domain>

Adittionally, the app should perform host validation using methods like getDefaultHostnameVerifier() or similar

SSLSocketFactory ssf = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) ssf.createSocket("", 443);
SSLSession session = socket.getSession();

StrictHostnameVerifier verifier = new StrictHostnameVerifier();
if (!verifier.verify(session.getPeerHost(), session)) {
// Throw some exception

Non compliant code

The application allows connections to arbitrary insecure hosts

<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true"></domain>
<domain includeSubdomains="true"></domain>
<base-config cleartextTrafficPermitted="true" />


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.