Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-55660

CVE-2024-55660: B3log Siyuan RCE Vulnerability

CVE-2024-55660 is a remote code execution flaw in B3log Siyuan caused by Server-Side Template Injection in the Sprig engine, allowing access to environment variables. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: April 8, 2026

CVE-2024-55660 Overview

CVE-2024-55660 is a Server-Side Template Injection (SSTI) vulnerability affecting SiYuan, a personal knowledge management system developed by B3log. Prior to version 3.1.16, the /api/template/renderSprig endpoint is vulnerable to SSTI attacks through the Sprig template engine. Although the Sprig engine has inherent limitations, this vulnerability allows unauthenticated attackers to access sensitive environment variables from the server, potentially exposing credentials, API keys, and other confidential configuration data.

Critical Impact

Attackers can exploit this SSTI vulnerability to extract sensitive environment variables from the server without authentication, potentially compromising secrets, credentials, and system configuration.

Affected Products

  • B3log SiYuan versions prior to 3.1.16
  • B3log SiYuan version 3.1.15 and earlier releases
  • Self-hosted SiYuan instances with exposed API endpoints

Discovery Timeline

  • 2024-12-12 - CVE-2024-55660 published to NVD
  • 2025-06-05 - Last updated in NVD database

Technical Details for CVE-2024-55660

Vulnerability Analysis

This Server-Side Template Injection vulnerability exists in SiYuan's template rendering functionality. The /api/template/renderSprig endpoint accepts user-controlled input that is processed by the Sprig template engine without adequate validation. When a malicious template payload is submitted, the server interprets and executes the template directives, allowing attackers to invoke Sprig functions that can read environment variables.

The vulnerability is classified under CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine) and CWE-94 (Improper Control of Generation of Code), both of which relate to insufficient input sanitization in code generation contexts. The attack can be executed remotely over the network without requiring authentication or user interaction.

Root Cause

The root cause of this vulnerability is the lack of path validation and input sanitization in the template rendering API. The original implementation did not verify whether the provided path parameter was within the expected workspace directory, allowing attackers to craft malicious template payloads. Additionally, the Sprig template engine provides built-in functions that can access system environment variables, which were not restricted in the vulnerable implementation.

Attack Vector

The attack is executed by sending a crafted HTTP request to the /api/template/renderSprig endpoint with a malicious Sprig template payload. The template payload can leverage Sprig's env function to extract environment variables from the server. Since the endpoint does not require authentication and accepts arbitrary template content, an attacker with network access to the SiYuan instance can exploit this vulnerability to enumerate sensitive server configuration data.

The security patch introduces path validation to ensure template operations are restricted to the workspace directory:

go
 	return
 }

+	if !util.IsAbsPathInWorkspace(p) {
+		ret.Code = -1
+		ret.Msg = "Path [" + p + "] is not in workspace"
+		return
+	}
+
 preview := false
 if previewArg := arg["preview"]; nil != previewArg {
 	preview = previewArg.(bool)

Source: GitHub Commit Details

Additional validation was added to the export functionality to prevent path traversal:

go
 // 将需要导出的文件/文件夹复制到临时文件夹
 for _, resourcePath := range resourcePaths {
-	resourceFullPath := filepath.Join(util.WorkspaceDir, resourcePath)    // 资源完整路径
+	resourceFullPath := filepath.Join(util.WorkspaceDir, resourcePath) // 资源完整路径
+	if !util.IsAbsPathInWorkspace(resourceFullPath) {
+		logging.LogErrorf("resource path [%s] is not in workspace", resourceFullPath)
+		err = errors.New("resource path [" + resourcePath + "] is not in workspace")
+		return
+	}
+
 	resourceBaseName := filepath.Base(resourceFullPath)                   // 资源名称
 	resourceCopyPath := filepath.Join(exportFolderPath, resourceBaseName) // 资源副本完整路径

Source: GitHub Commit Details

Detection Methods for CVE-2024-55660

Indicators of Compromise

  • HTTP requests to /api/template/renderSprig containing Sprig template syntax such as {{ env }} or {{ .Env }}
  • Unusual POST requests to template-related API endpoints from external IP addresses
  • Log entries showing template rendering errors with environment variable references
  • Evidence of enumeration attempts against multiple environment variable names

Detection Strategies

  • Monitor web application logs for requests targeting /api/template/renderSprig with suspicious payloads
  • Implement Web Application Firewall (WAF) rules to detect and block Sprig template injection patterns
  • Deploy intrusion detection signatures to identify SSTI attack patterns in HTTP request bodies
  • Review access logs for unauthenticated requests to sensitive API endpoints

Monitoring Recommendations

  • Enable detailed logging for all API requests to the SiYuan application
  • Configure alerts for high-volume requests to template rendering endpoints
  • Monitor for unusual patterns in server resource usage that may indicate exploitation attempts
  • Implement network segmentation to limit exposure of self-hosted SiYuan instances

How to Mitigate CVE-2024-55660

Immediate Actions Required

  • Upgrade SiYuan to version 3.1.16 or later immediately
  • Restrict network access to SiYuan instances using firewall rules
  • Review server environment variables for exposed sensitive credentials
  • Audit logs for signs of prior exploitation attempts
  • Rotate any secrets that may have been exposed through environment variables

Patch Information

B3log has released version 3.1.16 of SiYuan which contains a fix for this vulnerability. The patch implements the IsAbsPathInWorkspace() function to validate that all path parameters are contained within the expected workspace directory, preventing both the SSTI attack and potential path traversal issues. Users should upgrade to the patched version as soon as possible.

For detailed patch information, refer to the GitHub Commit Details and the GitHub Security Advisory GHSA-4pjc-pwgq-q9jp.

Workarounds

  • Place SiYuan instances behind a reverse proxy with authentication requirements
  • Use network-level access controls to restrict API endpoint access to trusted IP addresses only
  • Disable or block external access to the /api/template/renderSprig endpoint if not required
  • Deploy a WAF with rules specifically targeting template injection attack patterns
bash
# Example: Restrict access to SiYuan API using iptables
# Allow only localhost and trusted IP ranges
iptables -A INPUT -p tcp --dport 6806 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 6806 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 6806 -j DROP

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechB3log Siyuan

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.54%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/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
  • AvailabilityNone
  • CWE References
  • CWE-1336

  • CWE-94
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory GHSA-4pjc-pwgq-q9jp
  • Related CVEs
  • CVE-2026-40922: B3log Siyuan RCE Vulnerability

  • CVE-2026-33067: B3log Siyuan RCE Vulnerability

  • CVE-2026-33066: B3log Siyuan RCE Vulnerability

  • CVE-2026-33476: B3log Siyuan Path Traversal Vulnerability
Default Legacy - Prefooter | 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