Vulnerabilities in pkg:golang/github.com/mohammed90/caddy-ssh
PACKAGEGHSA-gmhj-xjfh-cf6m is a HIGH (CVSS 7.7) caddy-ssh vulnerable to authorization bypass vulnerability (CWE-287: Improper Authentication) affecting Github.com/mohammed90/caddy ssh libraries in the Go ecosystem. The issue involves caddy-ssh vulnerable to authorization bypass due to incorrect usage of pam library. Remediation is available in the latest vendor maintenance releases.
pkg:golang/github.com/mohammed90/caddy-ssh
Vulnerability advisories affecting package pkg:golang/github.com/mohammed90/caddy-ssh. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-gmhj-xjfh-cf6m | - | HIGH | Caddy-SSH vulnerable to Authorization Bypass due to incorrect usage of PAM library |
GHSA-gmhj-xjfh-cf6m at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N).
How to Fix GHSA-gmhj-xjfh-cf6m
To remediate this vulnerability, upgrade all affected Github.com/mohammed90/caddy ssh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/mohammed90/caddy-ssh to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/mohammed90/caddy-ssh
How to Check if You Are Affected
To determine whether your application is affected by GHSA-gmhj-xjfh-cf6m, inspect your project dependencies for Github.com/mohammed90/caddy ssh:
inspect dependencies for github.com/mohammed90/caddy-ssh
Analyze the terminal output to locate any version of Github.com/mohammed90/caddy ssh 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: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/mohammed90/caddy ssh, 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
GHSA-gmhj-xjfh-cf6m Affected Github.com/mohammed90/caddy ssh Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/mohammed90/caddy-ssh
|
Go |
0.0.1
All 1 versions
0.0.1
|
None specified
|
References
Frequently Asked Questions
What is GHSA-gmhj-xjfh-cf6m?
Which Github.com/mohammed90/caddy ssh versions are affected?
What version fixes GHSA-gmhj-xjfh-cf6m?
Is github.com/mohammed90/caddy-ssh affected?
What is the CVSS score of GHSA-gmhj-xjfh-cf6m?
What CWE is associated with GHSA-gmhj-xjfh-cf6m?
How can I check Go dependencies for GHSA-gmhj-xjfh-cf6m?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gmhj-xjfh-cf6m",
"modified" : "2022-09-23T21:37:21Z",
"published" : "2022-09-23T21:37:21Z",
"aliases" : [ ],
"summary" : "Caddy-SSH vulnerable to Authorization Bypass due to incorrect usage of PAM library",
"details" : "Not invoking a call to `pam_acct_mgmt` after a call to `pam_authenticate` to check the validity of a login can lead to an authorization bypass.\n\n### Impact\n\n#### Exploitability\n\nThe attack can be carried over the network. A complex non-standard configuration or a specialized condition is required for the attack to be successfully conducted. The attacker also requires access to a users credentials, be it expired, for an attack to be successful. There is no user interaction required for successful execution. The attack can affect components outside the scope of the target module.\n\n#### Impact\n\nUsing this attack vector, an attacker may access otherwise restricted parts of the system. The attack can be used to gain access to confidential files like passwords, login credentials and other secrets. Hence, it has a high impact on confidentiality. It may also be directly used to affect a change on a system resource. Hence has a medium to high impact on integrity. This attack may not be used to affect the availability of the system. Taking this account an appropriate CVSS v3.1 vector would be\n[AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L&version=3.1)\n\n### Root Cause Analysis\n\nIn this case, in the following PAM transaction, only a call to `pam.Authenticate` is used to login a user.\n\nhttps://github.com/mohammed90/caddy-ssh/blob/1d980ceea6e67765daf19b5e644c7a0773fdaa13/internal/authentication/os/pam.go#L60\n\nThis implies that a user with expired credentials can still login.\n\nThe bug can be verified easily by creating a new user account, expiring it with `chage -E0 <username>` and then trying to log in with the expired credentials.\n\n### Patches\nThis can be fixed by invoking a call to `pam.AcctMgmt` after a successful call to `pam.Authenticate`\n\n### References\n* [Man Page for pam_acct_mgmt](https://man7.org/linux/man-pages/man3/pam_acct_mgmt.3.html)\n* [CWE-863](http://cwe.mitre.org/data/definitions/863.html)\n* [CWE-285](http://cwe.mitre.org/data/definitions/285.html)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/mohammed90/caddy-ssh"
},
"versions" : [ "0.0.1" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mohammed90/caddy-ssh/security/advisories/GHSA-gmhj-xjfh-cf6m"
}, {
"type" : "WEB",
"url" : "https://github.com/mohammed90/caddy-ssh/commit/4b3e639d64c55f91152ffb51a4af35a8845c95a3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mohammed90/caddy-ssh"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-23T21:37:21Z",
"nvd_published_at" : null
}
}