Skip to content

XSS: href arbitrary code execution #1965

@petermikitsh

Description

@petermikitsh

Stencil version:

 @stencil/core@1.7.3

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

import { Component, h } from '@stencil/core';

@Component({
  tag: 'my-component'
})
export class MyComponent {
  render() {
    return [
      <a href="javascript:alert('xss')">XSS Link</a>,
      <a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgneHNzJyk8L3NjcmlwdD4=">XSS Link</a>
    ];
  }
}

Screen Shot 2019-10-20 at 2 50 09 PM

Screen Shot 2019-10-20 at 2 51 07 PM

Expected behavior:

Users should have to use innerHTML for this to work, to prevent the possibility of developers creating an XSS vulnerability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions