Vulnerabilities in pkg:maven/org.nanohttpd/nanohttpd-nanolets

PACKAGE
Advisory Identifier: GHSA-pr5m-4w22-8483
Advisory Summary

CVE-2020-13697 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nanohttpd nanolets libraries in the Maven ecosystem. The issue involves nanohttpd cross-site scripting vulnerability. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.nanohttpd/nanohttpd-nanolets

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.nanohttpd/nanohttpd-nanolets. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pr5m-4w22-8483 CVE-2020-13697 MODERATE NanoHTTPD Cross-site Scripting vulnerability

CVE-2020-13697 at a Glance

CVE Identifier CVE-2020-13697
GHSA Identifier GHSA-pr5m-4w22-8483
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Nanohttpd nanolets
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2020-13697

To remediate this vulnerability, upgrade all affected Nanohttpd nanolets dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.nanohttpd:nanohttpd-nanolets fixed: Latest secure release
<dependency>
    <groupId>org.nanohttpd</groupId>
    <artifactId>nanohttpd-nanolets</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.nanohttpd

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2020-13697, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.nanohttpd

Analyze the terminal output to locate any version of Nanohttpd nanolets in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.nanohttpd command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Nanohttpd nanolets, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An issue was discovered in RouterNanoHTTPD.java in NanoHTTPD through 2.3.1. The GeneralHandler class implements a basic GET handler that prints debug information as an HTML page. Any web server that extends this class without implementing its own GET handler is vulnerable to reflected XSS, because the GeneralHandler GET handler prints user input passed through the query string without any sanitization.

CVE-2020-13697 Affected Nanohttpd nanolets Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
org.nanohttpd:nanohttpd-nanolets
Maven
≤ 2.3.1

References

Frequently Asked Questions

What is CVE-2020-13697?
CVE-2020-13697 is a security vulnerability in Nanohttpd nanolets involving NanoHTTPD Cross-site Scripting vulnerability under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Nanohttpd nanolets versions are affected?
Affected versions include releases prior to current release patches across affected packages: org.nanohttpd:nanohttpd-nanolets.
What version fixes CVE-2020-13697?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is nanohttpd-nanolets affected?
Yes, org.nanohttpd:nanohttpd-nanolets is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2020-13697?
CVE-2020-13697 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Maven dependencies for CVE-2020-13697?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.nanohttpd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pr5m-4w22-8483",
  "modified" : "2023-09-12T16:37:20Z",
  "published" : "2021-02-25T16:32:34Z",
  "aliases" : [ "CVE-2020-13697" ],
  "summary" : "NanoHTTPD Cross-site Scripting vulnerability",
  "details" : "An issue was discovered in RouterNanoHTTPD.java in NanoHTTPD through 2.3.1. The GeneralHandler class implements a basic GET handler that prints debug information as an HTML page. Any web server that extends this class without implementing its own GET handler is vulnerable to reflected XSS, because the GeneralHandler GET handler prints user input passed through the query string without any sanitization.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.nanohttpd:nanohttpd-nanolets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-13697"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NanoHttpd/nanohttpd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NanoHttpd/nanohttpd/blob/efb2ebf85a2b06f7c508aba9eaad5377e3a01e81/nanolets/pom.xml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NanoHttpd/nanohttpd/blob/efb2ebf85a2b06f7c508aba9eaad5377e3a01e81/nanolets/src/main/java/org/nanohttpd/router/RouterNanoHTTPD.java"
  }, {
    "type" : "WEB",
    "url" : "https://www.vdoo.com/advisories/#CVE-2020-13697"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-02-24T07:10:37Z",
    "nvd_published_at" : "2021-02-23T08:15:00Z"
  }
}