CVE-2021-4253 (published 2022-12-18T22:15Z)

A vulnerability, which was classified as problematic, was found in ctrlo lenio. Affected is an unknown function in the library lib/Lenio.pm of the component Ticket Handler. The manipulation of the argument site_id leads to cross site scripting. It is possible to launch the attack remotely. The name of the patch is 7a1f90bd2a0ce95b8338ec0926902da975ec64d9. It is recommended to apply a patch to fix this issue. VDB-216210 is the identifier assigned to this vulnerability.

CVSS v3 base score: 6.1, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N)

Weakness information:
cwe_id: CWE-707
cwe_name: Improper Neutralization
description: The product does not ensure or incorrectly ensures that structured messages or data are well-formed and that certain security properties are met before being read from an upstream component or sent to a downstream component.
extended_description: 
            If a message is malformed, it may cause the message to be incorrectly interpreted.
            Neutralization is an abstract term for any technique that ensures that input (and output) conforms with expectations and is "safe."  This can be done by:
	    
	      checking that the input/output is already "safe" (e.g. validation)
	      transformation of the input/output to be "safe" using techniques such as filtering, encoding/decoding, escaping/unescaping, quoting/unquoting, or canonicalization
	      preventing the input/output from being directly provided by an attacker (e.g. "indirect selection" that maps externally-provided values to internally-controlled values)
	      preventing the input/output from being processed at all
	    
            This weakness typically applies in cases where the product prepares a control message that another process must act on, such as a command or query, and malicious input that was intended as data, can enter the control plane instead. However, this weakness also applies to more general cases where there are not always control implications.
         
         

Fix information:
repo_url: https://github.com/ctrlo/lenio
commit_details: repo_url: https://github.com/ctrlo/lenio
author: Andy Beverley
author_date: 2021-02-09 07:10:16+00:00
msg: Fix reflected XSS
repository: repo_url: https://github.com/ctrlo/lenio
repo_name: ctrlo/lenio
description: Facilities management system
repo_language: Perl
owner: ctrlo
file_changes: filename: Lenio.pm
change_type: ModificationType.MODIFY
diff: @@ -646,6 +646,9 @@ any ['get', 'post'] => '/ticket/:id?' => require_login sub {
     }
     elsif (defined($id) && !body_parameters->get('submit'))
     {
+        my $site_id = query_parameters->get('site_id')
+            ? int(query_parameters->get('site_id'))
+            : session('site_id');
         # If applicable, Prefill ticket fields with initial values based on task
         if ($task)
         {
@@ -660,13 +663,13 @@ any ['get', 'post'] => '/ticket/:id?' => require_login sub {
                     planned     => $date,
                     actionee    => $task->global ? 'external' : 'local',
                     task_id     => $task->id,
-                    site_id     => query_parameters->get('site_id') || session('site_id'),
+                    site_id     => $site_id,
                 });
             }
         }
         else {
             $ticket = rset('Ticket')->new({
-                site_id => query_parameters->get('site_id') || session('site_id'),
+                site_id => $site_id,
             });
         }
     }

programming_language: Perl