The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-46816

CVE-2025-46816: goshs RCE Vulnerability via WebSockets

CVE-2025-46816 is a remote code execution vulnerability in goshs that allows unauthenticated attackers to execute arbitrary commands via WebSockets. This article covers the technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2025-46816 Overview

CVE-2025-46816 is a critical Command Injection vulnerability in goshs, a SimpleHTTPServer written in Go. Starting in version 0.3.4 and prior to version 1.0.5, running goshs without arguments makes it possible for anyone to execute commands on the server. The function dispatchReadPump does not check the option cli -c, thus allowing anyone to execute arbitrary commands through the use of websockets.

Critical Impact

Unauthenticated remote attackers can execute arbitrary commands on the server via websocket connections, potentially leading to full system compromise.

Affected Products

  • goshs versions >= 0.3.4 and < 1.0.5

Discovery Timeline

  • 2025-05-06 - CVE CVE-2025-46816 published to NVD
  • 2025-05-07 - Last updated in NVD database

Technical Details for CVE-2025-46816

Vulnerability Analysis

This vulnerability exists in the websocket handling code of goshs. The core issue is that the dispatchReadPump function processes incoming websocket messages of type "command" without validating whether the CLI option (-c) was actually enabled by the server administrator. This architectural flaw means that even when goshs is started without the command-line interface flag, attackers can still send command execution requests through the websocket interface.

The vulnerability is classified as CWE-77 (Command Injection), which occurs when an application constructs all or part of a command using externally-influenced input without proper neutralization. In this case, commands submitted via websocket are directly executed through the cli.RunCMD() function regardless of the server's intended configuration.

Root Cause

The root cause is a missing authorization check in the websocket message handler. The Hub structure was initialized without awareness of the CLI configuration state, and the client message processing logic unconditionally executed commands received via the "command" packet type. The vulnerable code path allowed the cli.RunCMD(command) function to be called on any command string extracted from incoming websocket packets.

Attack Vector

The attack can be carried out remotely over the network without any authentication. An attacker simply needs to establish a websocket connection to a running goshs instance and send a properly formatted JSON packet with type "command" containing the arbitrary command to execute. Since no authentication or configuration checks are performed, the server will execute the command and return the output to the attacker.

go
// Vulnerable code in ws/client.go (before patch)
case "command":
	var command string
	if err := json.Unmarshal(packet.Content, &command); err != nil {
		logger.Errorf("Error reading json packet: %+v", err)
	}
	logger.Debugf("Command was: %+v", command)
	output, err := cli.RunCMD(command)
	if err != nil {
		logger.Errorf("Error running command: %+v", err)
	}
	logger.Debugf("Output: %+v", output)
	c.updateCLI(output)

Source: GitHub Commit

Detection Methods for CVE-2025-46816

Indicators of Compromise

  • Unexpected websocket connections to goshs instances from unknown IP addresses
  • Log entries showing command execution via websocket when CLI mode was not enabled
  • Unusual process spawning from the goshs process
  • Network traffic containing websocket frames with "command" type packets

Detection Strategies

  • Monitor websocket traffic to goshs servers for packets containing "command" type messages
  • Implement network-level detection for websocket upgrade requests to unexpected endpoints
  • Review goshs process logs for debug messages indicating command execution (Command was: and Output: patterns)
  • Deploy endpoint detection to identify unexpected child processes spawned by goshs

Monitoring Recommendations

  • Enable verbose logging on goshs instances to capture websocket activity
  • Set up alerts for any websocket connections to production goshs deployments
  • Monitor for reconnaissance activity targeting common goshs ports
  • Implement network segmentation to restrict access to goshs instances

How to Mitigate CVE-2025-46816

Immediate Actions Required

  • Upgrade goshs to version 1.0.5 or later immediately
  • If upgrade is not immediately possible, stop all running goshs instances that do not require the CLI feature
  • Review logs for any signs of exploitation before patching
  • Restrict network access to goshs instances to trusted networks only

Patch Information

Version 1.0.5 fixes this issue by adding a proper check for the CLI option before processing command requests. The patch modifies the Hub initialization to include CLI configuration state and adds a conditional check (if c.hub.cliEnabled) before executing any commands received via websocket.

For detailed patch information, see the GitHub Security Advisory GHSA-rwj2-w85g-5cmm.

Workarounds

  • Disable or block websocket connections at the network level if they are not required
  • Place goshs behind a reverse proxy that filters websocket upgrade requests
  • Use firewall rules to restrict access to goshs instances to trusted IP addresses only
  • Run goshs in isolated network segments with no access to sensitive systems
go
// Patched code in ws/client.go - CLI check added
case "command":
	if c.hub.cliEnabled {
		var command string
		if err := json.Unmarshal(packet.Content, &command); err != nil {
			logger.Errorf("Error reading json packet: %+v", err)
		}
		logger.Debugf("Command was: %+v", command)
		output, err := cli.RunCMD(command)
		if err != nil {
			logger.Errorf("Error running command: %+v", err)
		}
		logger.Debugf("Output: %+v", output)
		c.updateCLI(output)
	}

Source: GitHub Commit

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGoshs

  • SeverityCRITICAL

  • CVSS Score9.4

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-77
  • Technical References
  • GitHub Commit Changes

  • GitHub Security Advisory GHSA-rwj2-w85g-5cmm
  • Related CVEs
  • CVE-2026-34581: goshs Authentication Bypass Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English