Skip to content

XSS via unescaped HTML attribute values #56

@hugithordarson

Description

@hugithordarson

NGHTMLUtilities.createElementStringWithAttributes() does not escape attribute values, making any binding-supplied attribute value an XSS vector.

Affected elements

Any element that uses addAssociationValuesToAttributes() or createElementStringWithAttributes() to emit binding-driven attribute values:

  • NGTextField
  • NGPopUpButton
  • NGCheckbox
  • NGForm (pass-through attributes)
  • NGSubmitButton
  • NGHyperlink
  • NGGenericElement
  • NGGenericContainer

Example attack

A binding value like " onclick="alert('xss') written into any pass-through attribute results in script execution in the rendered page.

Fix

Escape attribute values when emitting them. Content escaping is already correct in NGString/NGText — this is the symmetric fix for attribute context. Should be a single fix in the utility method with broad impact across the element library.

Severity

Critical — broad XSS surface across most form elements. M2 blocker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions