Ticket #2531468 (closed defect)

Reporter


Ryan Grove
Opened: 11/21/11
Last modified: 05/10/12
Status: closed
Type: defect
Resolution: fixed

Owner


Tripp Bridges
Target Release: 3.5.0
Priority: P1 (critical)
Summary: Axis: `title` attribute should either be renamed `titleHTML` or should not be passed to innerHTML
Description:

In Axis.js on line 468, the value of the Axis instance's `title` attribute is passed directly to innerHTML: http://yuilibrary.com/yui/docs/api/files/charts_js_Axis.js.html#l468

This is a potential security issue if the title attribute contains a user-supplied string.

If titles don't need to support HTML, then the title should be appended safely to titleTextNode as a DOM text node (https://developer.mozilla.org/en/DOM:document.createTextNode) rather than as HTML.
If titles do need to support HTML, then the `title` attribute should be renamed to `titleHTML` and its documentation should be updated to clearly state that its value will be passed directly to
innerHTML, and that any user-supplied input should be escaped with Y.Escape.html() before being set in the `titleHTML` attribute.

Type: defect Observed in Version: 3.4.1
Component: Charts Severity: S1 (critical)
Assigned To: Tripp Bridges Target Release: 3.5.0
Location: Library Code Priority: P1 (critical)
Tags: security Relates To: #2531476
Browsers: N/A
URL:
Test Information:

Change History

Tripp Bridges

YUI Developer

Posted: 11/21/11
  • status changed from new to accepted

Eric Ferraiuolo

YUI Developer

Posted: 11/22/11
  • relatesto changed to 2531476

Adding a reference to a discussion on attribute deprecation/aliasing: http://yuilibrary.com/projects/yui3/ticket/2531476

Ryan Grove

YUI Developer

Posted: 11/28/11

Update based on a discussion with Matt: Please ensure that the data type of the "title" attribute in the API docs is "HTML". The API doc skin itself can then provide the necessary boilerplate warning about using Y.Escape.html(), etc. There's no need to rename the attribute as long as the data type is updated.

Tripp Bridges

YUI Developer

Posted: 12/14/11
  • estimated changed from 0 to 0.5
  • remaining changed from 0 to 0.5
  • sprint changed to sprint 2

Tripp Bridges

YUI Developer

Posted: 01/29/12
  • completed changed from 0 to 0.25
  • remaining changed from 0.5 to 0
  • status changed from accepted to checkedin

Tripp Bridges

YUI Developer

Posted: 01/29/12

Titles are no longer attached with innerHTML. I added an appendTitleFunction attribute which is a function that attaches the title with appendChild. The attribute can be overridden with a different function if necessary.

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • resolution changed to fixed

checkedin -> closed

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • status changed from checkedin to closed

checkedin -> closed