CVE-2022-24732: Github.com/foxcpp/maddy Use Of A Key Past Vulnerability

MODERATE
Advisory Identifier: GHSA-6cp7-g972-w9m9
CVSS 6.3
CWE-613 CWE-324
Published
Advisory Summary

CVE-2022-24732 is a MODERATE (CVSS 6.3) use of a key past vulnerability (CWE-613: Insufficient Session Expiration) affecting Github.com/foxcpp/maddy libraries in the Go ecosystem. The issue involves use of a key past its expiration date and insufficient session expiration in maddy mail server. Remediation is available by upgrading affected packages to version 0.5.4.

CVE-2022-24732 at a Glance

CVE Identifier CVE-2022-24732
GHSA Identifier GHSA-6cp7-g972-w9m9
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Github.com/foxcpp/maddy
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix CVE-2022-24732

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

github.com/foxcpp/maddy fixed: 0.5.4
Upgrade github.com/foxcpp/maddy to 0.5.4
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 github.com/foxcpp/maddy

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24732, inspect your project dependencies for Github.com/foxcpp/maddy:

inspect dependencies for github.com/foxcpp/maddy

Analyze the terminal output to locate any version of Github.com/foxcpp/maddy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.4), 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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Github.com/foxcpp/maddy, 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

### Impact Any configuration on any maddy version <0.5.4 using auth.pam is affected. No password expiry or account expiry checking is done when authenticating using PAM. ### Patches Patch is available as part of the 0.5.4 release. ### Workarounds If /etc/shadow authentication is used, it is possible to replace auth.pam with auth.shadow which is not affected. It is possible to blacklist expired accounts via existing filtering mechanisms (e.g. auth_map to invalid accounts in storage.imapsql). ### References * https://github.com/foxcpp/maddy/blob/3412e59a2c92106e194fa69f2f1017c020037c9c/internal/auth/pam/pam.c * https://linux.die.net/man/3/pam_acct_mgmt ### For more information If you have any questions or comments about this advisory: * Open an issue in https://github.com/foxcpp/maddy * Email fox.cpp@disroot.org

CVE-2022-24732 Affected Github.com/foxcpp/maddy Versions

1 component(s)
Fixed Versions:
0.5.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/foxcpp/maddy
Go
< 0.5.4
0.5.4

References

Frequently Asked Questions

What is CVE-2022-24732?
CVE-2022-24732 is a security vulnerability in Github.com/foxcpp/maddy involving Use of a Key Past its Expiration Date and Insufficient Session Expiration in Maddy Mail Server under CWE-613: Insufficient Session Expiration.
Which Github.com/foxcpp/maddy versions are affected?
Affected versions include releases prior to 0.5.4 across affected packages: github.com/foxcpp/maddy.
What version fixes CVE-2022-24732?
Upgrading to 0.5.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/foxcpp/maddy affected?
Yes, github.com/foxcpp/maddy is affected in releases prior to 0.5.4. Upgrade your dependency to 0.5.4 or later.
What is the CVSS score of CVE-2022-24732?
CVE-2022-24732 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2022-24732?
CVE-2022-24732 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Go dependencies for CVE-2022-24732?
Run the dependency tree command: 'inspect dependencies for github.com/foxcpp/maddy'. 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-6cp7-g972-w9m9",
  "modified" : "2022-03-18T20:12:30Z",
  "published" : "2022-03-07T16:59:31Z",
  "aliases" : [ "CVE-2022-24732" ],
  "summary" : "Use of a Key Past its Expiration Date and Insufficient Session Expiration in Maddy Mail Server",
  "details" : "### Impact\n\nAny configuration on any maddy version <0.5.4 using auth.pam is affected.\n\nNo password expiry or account expiry checking is done when authenticating using PAM.\n\n### Patches\n\nPatch is available as part of the 0.5.4 release.\n\n### Workarounds\n\nIf /etc/shadow authentication is used, it is possible to replace auth.pam with auth.shadow which is not affected.\n\nIt is possible to blacklist expired accounts via existing filtering mechanisms (e.g. auth_map to invalid accounts in storage.imapsql).\n\n### References\n\n* https://github.com/foxcpp/maddy/blob/3412e59a2c92106e194fa69f2f1017c020037c9c/internal/auth/pam/pam.c\n* https://linux.die.net/man/3/pam_acct_mgmt\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in https://github.com/foxcpp/maddy\n* Email fox.cpp@disroot.org\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/foxcpp/maddy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/foxcpp/maddy/security/advisories/GHSA-6cp7-g972-w9m9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24732"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/foxcpp/maddy/commit/7ee6a39c6a1939b376545f030a5efd6f90913583"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/foxcpp/maddy"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/foxcpp/maddy/releases/tag/v0.5.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-324", "CWE-613" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-07T16:59:31Z",
    "nvd_published_at" : "2022-03-09T20:15:00Z"
  }
}