A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2024-54148

CVE-2024-54148: Gogs Path Traversal Vulnerability

CVE-2024-54148 is a path traversal vulnerability in Gogs that allows attackers to gain SSH access via crafted symlink files. This article covers the technical details, affected versions, security impact, and mitigation.

Published: May 26, 2026

CVE-2024-54148 Overview

CVE-2024-54148 is a path traversal vulnerability in Gogs, an open source self-hosted Git service. An authenticated malicious user can commit and edit a crafted symlink file in a repository to gain SSH access to the underlying server. The flaw is tracked under [CWE-22] (Improper Limitation of a Pathname to a Restricted Directory) and stems from the repository file editor failing to reject symlinks during edit operations. The vulnerability is fixed in Gogs 0.13.1.

Critical Impact

An authenticated repository user can leverage symlink editing to write outside the repository boundary and obtain SSH access to the host running Gogs.

Affected Products

  • Gogs versions prior to 0.13.1
  • Self-hosted Gogs Git service deployments
  • Any environment exposing Gogs repository editing to untrusted users

Discovery Timeline

  • 2024-12-23 - CVE-2024-54148 published to NVD
  • 2025-04-10 - Last updated in NVD database

Technical Details for CVE-2024-54148

Vulnerability Analysis

The vulnerability resides in the repository web editor implemented in internal/route/repo/editor.go. When a user edits a file through the Gogs web interface, the editor did not reject entries that are symbolic links during file rename and edit flows. An attacker with commit permission to any repository can craft a symlink pointing to a sensitive path on the server, then use the web editor to modify the symlink target's contents.

Because the Gogs process typically runs as the git user, an attacker can write to files such as ~/.ssh/authorized_keys. This grants SSH access to the host, converting limited repository write access into remote interactive access to the server.

Root Cause

The root cause is missing validation in the file editing handler. The code path that permitted renaming a file checked for symlinks, but the path that updated file content while keeping the name did not. The fix in pull request #7857 adds a symlink check to the edit branch so that any attempt to modify a symlink entry returns the repo.editor.file_is_a_symlink form error.

Attack Vector

Exploitation requires a network-reachable Gogs instance and an authenticated account with write access to a repository. The attacker commits a symlink whose target is a sensitive file on the server, then uses the web editor to rewrite the symlink's content. No user interaction is required beyond the attacker's own session.

go
// Patch in internal/route/repo/editor.go from PR #7857
				return
			}
		} else {
+			// 🚨 SECURITY: Do not allow editing if the target file is a symlink.
			if entry.IsSymlink() {
				c.FormErr("TreePath")
				c.RenderWithErr(c.Tr("repo.editor.file_is_a_symlink", part), tmplEditorEdit, &f)

Source: Gogs commit c94baec9. The patch ensures the editor rejects edits when entry.IsSymlink() returns true, closing the path traversal vector.

Detection Methods for CVE-2024-54148

Indicators of Compromise

  • Repository commits adding symlink objects whose targets point outside the repository tree, particularly to paths under the Gogs service account home directory.
  • Unexpected modifications to ~/.ssh/authorized_keys or other dotfiles owned by the git user on the Gogs host.
  • New SSH login sessions for the Gogs service account from unfamiliar source IP addresses.

Detection Strategies

  • Audit Git object history for 120000 mode entries (symlinks) and review their targets for absolute paths or .. traversal sequences.
  • Inspect Gogs application logs for repeated editor POST requests against symlink tree paths.
  • Monitor file integrity on sensitive host paths such as ~/.ssh/authorized_keys, ~/.bashrc, and Gogs configuration files.

Monitoring Recommendations

  • Alert on changes to authorized_keys files for any service account running Git hosting software.
  • Track SSH authentication events for the Gogs runtime user and correlate with web editor activity timestamps.
  • Forward Gogs and host audit logs to a centralized analytics platform for retroactive hunting once the version inventory is known.

How to Mitigate CVE-2024-54148

Immediate Actions Required

  • Upgrade all Gogs instances to version 0.13.1 or later without delay.
  • Rotate SSH keys present in the Gogs service account's authorized_keys and review for unauthorized entries.
  • Audit recent commits across hosted repositories for newly introduced symlinks and remove suspicious entries.

Patch Information

The fix is delivered in Gogs 0.13.1 via pull request #7857 and commit c94baec9. Details are published in the GHSA-r7j8-5h9c-f6fx advisory.

Workarounds

  • Restrict repository write access to trusted users until the upgrade is complete.
  • Run the Gogs process under a dedicated low-privilege account whose home directory contains no SSH material or sensitive dotfiles.
  • Disable the web editor for untrusted users by enforcing repository policies that require signed commits via the Git protocol only.
bash
# Verify installed Gogs version and upgrade
/path/to/gogs --version
# Expected after patch: Gogs version 0.13.1 or later

# Inspect repositories for symlink entries
git ls-tree -r HEAD | awk '$1 == "120000" {print $4, "->", $3}'

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechGogs

  • SeverityHIGH

  • CVSS Score8.7

  • EPSS Probability0.97%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Technical References
  • GitHub Issue Report
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Pull Request

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-23633: Gogs Path Traversal Vulnerability

  • CVE-2026-24135: Gogs Path Traversal Vulnerability

  • CVE-2026-26022: Gogs Self-Hosted Git Service XSS Vulnerability

  • CVE-2026-26196: Gogs Information Disclosure Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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