# CVE-2023-5142: H3C ER6300G2 Config File userLogin.asp path traversal

> Remote attackers can exploit a path traversal vulnerability in H3C routers to read arbitrary files from the device.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 24 Sep 2023
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-cmhm-c9j2-c4m6

## What is CVE-2023-5142?

CVE-2023-5142 is a low-severity path traversal vulnerability in H3C ER2100n, published on 24 Sep 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A vulnerability classified as problematic was found in H3C GR-1100-P, GR-1108-P, GR-1200W, GR-1800AX, GR-2200, GR-3200, GR-5200, GR-8300, ER2100n, ER2200G2, ER3200G2, ER3260G2, ER5100G2, ER5200G2 and ER6300G2 up to 20230908. This vulnerability affects unknown code of the file /userLogin.asp of the component Config File Handler. The manipulation leads to path traversal. The attack can be initiated remotely. The complexity of an attack is rather high. The exploitation appears to be difficult. The exploit has been disclosed to the public and may be used. VDB-240238 is the identifier assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2023-5142?

It affects 15 products.


Products: H3c Er2100n Firmware, H3c Er2200g2 Firmware, H3c Er3200g2 Firmware, H3c Er3260g2 Firmware, H3c Er5100g2 Firmware, H3c Er5200g2 Firmware, H3c Er6300g2 Firmware, H3c Gr-1100-P Firmware, H3c Gr-1108-P Firmware, H3c Gr-1200w Firmware, H3c Gr-1800ax Firmware, H3c Gr-2200 Firmware, H3c Gr-3200 Firmware, H3c Gr-5200 Firmware, H3c Gr-8300 Firmware.

## How do I fix CVE-2023-5142?

No fix has been published for CVE-2023-5142 yet. Limit exposure of the affected software until one is available.

## Is CVE-2023-5142 being exploited?

There is no known exploitation of CVE-2023-5142 in the wild and no public exploit code.

Public exploit code:

- CVE-2023-5142 (github_poc): https://github.com/kuangxiaotu/CVE-H3C-Report

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-5142 and fix it if it is affected.

What it is: CVE-2023-5142 is a low-severity path traversal vulnerability in H3C ER2100n, published on 24 Sep 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-5142 in the wild and no public exploit code.

Affected product: H3C ER2100n. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-5142/ (Markdown: https://insights.sbomify.com/CVE-2023-5142/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-5142
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-5142
- OSV: https://osv.dev/vulnerability/CVE-2023-5142

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-5142/
Summaries are generated and may contain mistakes; the official description above is the record.
