/

CVE-2022-51029

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Synway SMG Gateway /down.php

CVE-2022-51029

Received

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Synway SMG Gateway Management Software contains a path traversal vulnerability in the /down.php file-download handler. An unauthenticated attacker who can reach the endpoint may be able to read files accessible to the software process by supplying a traversal path through the downfile parameter.

Affected context

The issue affects Synway SMG Gateway Management Software builds through 2022-03-15. It occurs in the /down.php download handler, where the downfile parameter is used to select a file. Risk is present when the endpoint is reachable and the supplied path is not safely constrained to an intended download directory.

Exploit preconditions

  • Attack surface: Network-accessible HTTP endpoint at /down.php
  • Required access: No authentication is required, according to the vulnerability description
  • Trigger point: Processing of a multipart POST request that supplies the downfile parameter
  • Why exploitation is possible: The requested path may escape the intended download location if traversal sequences are not rejected or safely resolved

Why this happens

The underlying issue is insufficient validation and containment of a user-controlled file path. If the application uses that path to access a file without ensuring the resolved location remains within an approved directory, traversal can lead to unauthorized file access. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • An attacker may read sensitive files that are accessible to the application process.
  • Exposed files could disclose system, application, or configuration information.
  • Disclosed information could support further attacks against the gateway or its environment.

General mitigation guidance

Defensive patterns focus on ensuring file access is limited to intended resources:

  • Prefer server-side identifiers mapped to approved files over accepting arbitrary paths.
  • Canonicalize requested paths and verify that resolved paths remain within an explicitly allowed directory.
  • Reject traversal and unexpected path forms, while avoiding reliance on character filtering alone.
  • Run the service with only the filesystem permissions it needs, reducing the impact of any file access flaw.
  • Keep file-download behavior narrowly scoped and validate inputs before filesystem access.

How teams detect issues like this

  • Review file-download handlers for user-controlled values that reach filesystem APIs.
  • Use static analysis to flag path construction from request parameters and verify canonicalization and directory-boundary checks.
  • Inspect web logs and alerts for unusual requests to /down.php, unexpected downfile values, or repeated file-download attempts.
  • Apply policy checks that require file access to use approved directories and least-privilege service permissions.

Frequently asked

questions

The described attack uses a network-accessible endpoint. An attacker who can reach /down.php may be able to exploit it without authentication.

No authentication is required according to the vulnerability description, but the endpoint must be reachable and the application process must be able to access the targeted file.

Avoid using client-supplied paths directly. Map requests to approved files, resolve paths canonically, and confirm they remain inside an allowed directory before access.

Review filesystem operations that use request data, enforce strict path boundaries, and limit the service account's filesystem permissions.

Find out what's already
exploitable in your codebase.