The "Add a keyword" functionality on the page http://localhost/admin.php?page=tags contains an XSS vulnerability, allowing users to execute arbitrary JavaScript code through this feature. The severity of this issue is low.
Vulnerability Call Chain Analysis:
admin\themes\default\template\tags.tpl
This is the front-end page for the "Add a keyword" feature. The data filled in by the user is placed inside a form element with the ID 'add-tag'.
admin\themes\default\js\tags.js
This form element triggers the following function upon submission:
admin\themes\default\js\tags.js #showMessage
The showMessage function is called, and it uses the html function:
The function inserts the user's input into the <p> tag inside the <info-error> element on the front-end page, leading to an XSS vulnerability.
Attack Effect:
Fix Recommendation:
In the showMessage function within admin\themes\default\js\tags.js, replace the html function with the text function:
This change will prevent the XSS vulnerability from being triggered. The response page will be:
The "**Add a keyword**" functionality on the page http://localhost/admin.php?page=tags contains an XSS vulnerability, allowing users to execute arbitrary JavaScript code through this feature. The severity of this issue is low.
### Vulnerability Call Chain Analysis:
1. **admin\themes\default\template\tags.tpl**
This is the front-end page for the "Add a keyword" feature. The data filled in by the user is placed inside a form element with the ID 'add-tag'.
<img width="1349" height="312" alt="Image" src="https://github.com/user-attachments/assets/1b5fd682-0bed-4428-964e-f094b9482ae0" />
2. **admin\themes\default\js\tags.js**
This form element triggers the following function upon submission:
<img width="1245" height="547" alt="Image" src="https://github.com/user-attachments/assets/8ab5cd1f-e31d-4105-a551-1f5ed8b18319" />
3. **admin\themes\default\js\tags.js #showMessage**
The `showMessage` function is called, and it uses the `html` function:
<img width="592" height="176" alt="Image" src="https://github.com/user-attachments/assets/326baab6-cbda-4e2d-81b4-4810f038f4aa" />
The function inserts the user's input into the `<p>` tag inside the `<info-error>` element on the front-end page, leading to an XSS vulnerability.
<img width="2550" height="1299" alt="Image" src="https://github.com/user-attachments/assets/a3250f6b-fa42-47bd-91b8-df1e8299e5e5" />
### Attack Effect:
<img width="2540" height="735" alt="Image" src="https://github.com/user-attachments/assets/37d20070-6ae2-455c-b441-401765805420" />
### Fix Recommendation:
In the `showMessage` function within `admin\themes\default\js\tags.js`, replace the `html` function with the `text` function:
<img width="605" height="174" alt="Image" src="https://github.com/user-attachments/assets/1982f695-dd17-4caa-9560-4d556e2abbdd" />
This change will prevent the XSS vulnerability from being triggered. The response page will be:
<img width="2554" height="703" alt="Image" src="https://github.com/user-attachments/assets/64896d8f-53b0-4cdd-bf49-7528c2ba6e77" />
---
<!-- github-sync-id:3251313036 -->
What I see is only the possibility of adding a script in the input but then the script tags are well removed and above all you do this in the administration and Piwigo authorizes admins to put html in descriptions, titles etc....
What I see is only the possibility of adding a script in the input but then the script tags are well removed and above all you do this in the administration and Piwigo authorizes admins to put html in descriptions, titles etc....
<!-- github-comment-id:3143213318 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The "Add a keyword" functionality on the page http://localhost/admin.php?page=tags contains an XSS vulnerability, allowing users to execute arbitrary JavaScript code through this feature. The severity of this issue is low.
Vulnerability Call Chain Analysis:
This is the front-end page for the "Add a keyword" feature. The data filled in by the user is placed inside a form element with the ID 'add-tag'.
This form element triggers the following function upon submission:
The
showMessagefunction is called, and it uses thehtmlfunction:The function inserts the user's input into the
<p>tag inside the<info-error>element on the front-end page, leading to an XSS vulnerability.Attack Effect:
Fix Recommendation:
In the
showMessagefunction withinadmin\themes\default\js\tags.js, replace thehtmlfunction with thetextfunction:This change will prevent the XSS vulnerability from being triggered. The response page will be:
What I see is only the possibility of adding a script in the input but then the script tags are well removed and above all you do this in the administration and Piwigo authorizes admins to put html in descriptions, titles etc....