Skip to content

List tables and view pages print object names without escaping (stored XSS) #546

Closed

Description

@caseysoftware

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)

  1. As any user who can add links, add a link named <img src=x onerror=alert(document.domain)>.
  2. 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

  1. added 2 commits that reference this issue on Nov 11, 2026
    d466224
    1d13408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions