You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
List tables and view pages print object names without escaping (stored XSS) #546
w2p_Output_HTMLHelper::buildCellContent() prints _name values without escaping, so markup in a name runs in every list built with w2p_Output_ListTable.
Where
classes/w2p/Output/HTMLHelper.class.php, case '_name': $cell = '<a href="'.$link.'">'.$icon.$value.'</a>'; ($value is raw).
The same file's _company / _contact / _task / _department / _project cases concatenate the loaded object's name raw.
classes/w2p/Output/HTML/ViewHelper.class.php, addField(), company / department / project / task case: same.
bind() runs htmlentities() on input, but the value is decoded again before it is saved, so the row holds the raw text and these cells output it as HTML.
Reproduce (master 8727ad5c, 5.0.0-rc3, Cedar Lane demo data)
As any user who can add links, add a link named <img src=x onerror=alert(document.domain)>.
Open Links. The <img> tag is in the page unescaped, so the onerror handler runs in the browser of anyone who opens the list.
Any *_name column fed from user input behaves the same way (found while porting the Notebook add-on, whose note titles render as HTML in its list). The object-link and ViewHelper cases were found by reading the code.
Fix
Escape $value with htmlspecialchars($value, ENT_QUOTES, 'UTF-8') in the _name case, and the loaded names in the object-link cases and in ViewHelper. Worth checking the _author / _creator / _owner display names at the same time.
Activity
Escape names printed by list tables and view pages
Escape names in calendars, tooltips, task lists and view headers
FormHelper: escape the linked object's name
FormHelper: escape the linked object's name