CVE-2025-46816: Github.com/patrickhener/goshs Goshs Route Not Protected, Allows Vulnerability

CRITICAL
Advisory Identifier: GHSA-rwj2-w85g-5cmm
CVSS 9.4
CWE-284 CWE-77
Published
Advisory Summary

CVE-2025-46816 is a CRITICAL (CVSS 9.4) goshs route not protected, allows vulnerability (CWE-284: Improper Access Control) affecting Github.com/patrickhener/goshs libraries in the Go ecosystem. The issue involves goshs route not protected, allows command execution. Remediation is available by upgrading affected packages to version 1.0.5.

CVE-2025-46816 at a Glance

CVE Identifier CVE-2025-46816
GHSA Identifier GHSA-rwj2-w85g-5cmm
Severity CRITICAL
CVSS v3.1 Base Score 9.4
CWE Classification CWE-284: Improper Access Control
Affected Product Github.com/patrickhener/goshs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.4

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

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

How to Fix CVE-2025-46816

To remediate this vulnerability, upgrade all affected Github.com/patrickhener/goshs 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/patrickhener/goshs fixed: 1.0.5
Upgrade github.com/patrickhener/goshs to 1.0.5
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/patrickhener/goshs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-46816, inspect your project dependencies for Github.com/patrickhener/goshs:

inspect dependencies for github.com/patrickhener/goshs

Analyze the terminal output to locate any version of Github.com/patrickhener/goshs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.5), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Github.com/patrickhener/goshs, 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 It seems that when running **goshs** without arguments it is possible for anyone to execute commands on the server. This was tested on version **1.0.4** of **goshs**. The command function was introduced in version **0.3.4**. ### Details It seems that the function ```dispatchReadPump``` does not checks the option cli ```-c```, thus allowing anyone to execute arbitrary command through the use of websockets. ### PoC Used **websocat** for the POC: ```bash echo -e '{"type": "command", "content": "id"}' |./websocat 'ws://192.168.1.11:8000/?ws' -t ``` ### Impact The vulnerability will only impacts goshs server on vulnerable versions.

CVE-2025-46816 Affected Github.com/patrickhener/goshs Versions

1 component(s)
Fixed Versions:
1.0.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/patrickhener/goshs
Go
≥ 0.3.4
< 1.0.5
1.0.5

References

Frequently Asked Questions

What is CVE-2025-46816?
CVE-2025-46816 is a security vulnerability in Github.com/patrickhener/goshs involving goshs route not protected, allows command execution under CWE-284: Improper Access Control.
Which Github.com/patrickhener/goshs versions are affected?
Affected versions include releases prior to 1.0.5 across affected packages: github.com/patrickhener/goshs.
What version fixes CVE-2025-46816?
Upgrading to 1.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/patrickhener/goshs affected?
Yes, github.com/patrickhener/goshs is affected in releases prior to 1.0.5. Upgrade your dependency to 1.0.5 or later.
What is the CVSS score of CVE-2025-46816?
CVE-2025-46816 has a CVSS v3.1 base score of 9.4 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2025-46816?
CVE-2025-46816 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for CVE-2025-46816?
Run the dependency tree command: 'inspect dependencies for github.com/patrickhener/goshs'. 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-rwj2-w85g-5cmm",
  "modified" : "2025-05-06T21:44:02Z",
  "published" : "2025-05-06T16:45:17Z",
  "aliases" : [ "CVE-2025-46816" ],
  "summary" : "goshs route not protected, allows command execution",
  "details" : "### Summary\n\nIt seems that when running **goshs** without arguments it is possible for anyone to execute commands on the server. This was tested on version **1.0.4** of **goshs**. The command function was introduced in version **0.3.4**.\n\n### Details\n\nIt seems that the function ```dispatchReadPump``` does not checks the option cli ```-c```, thus allowing anyone to execute arbitrary command through the use of websockets.\n\n### PoC\n\nUsed **websocat** for the POC:\n```bash\necho -e '{\"type\": \"command\", \"content\": \"id\"}' |./websocat 'ws://192.168.1.11:8000/?ws' -t\n```\n\n### Impact\n\nThe vulnerability will only impacts goshs server on vulnerable versions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/patrickhener/goshs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.4"
      }, {
        "fixed" : "1.0.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patrickhener/goshs/security/advisories/GHSA-rwj2-w85g-5cmm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-46816"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patrickhener/goshs/commit/160220974576afe5111485b8d12fd36058984cfa"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patrickhener/goshs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-77" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-06T16:45:17Z",
    "nvd_published_at" : "2025-05-06T19:16:00Z"
  }
}