CVE-2014-125078 (Python, published 2023-01-15T09:15Z)
Description: value: A vulnerability was found in yanheven console and classified as problematic. Affected by this issue is some unknown functionality of the file horizon/static/horizon/js/horizon.instances.js. The manipulation leads to cross site scripting. The attack may be launched remotely. The patch is identified as 32a7b713468161282f2ea01d5e2faff980d924cd. It is recommended to apply a patch to fix this issue. VDB-218354 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 5.4)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/yanheven/console
Files changed:
horizon/static/horizon/js/horizon.instances.js
horizon/tables/base.py
openstack_dashboard/dashboards/admin/groups/tables.py
openstack_dashboard/dashboards/admin/users/tables.py
openstack_dashboard/dashboards/project/stacks/tables.py
openstack_dashboard/dashboards/project/stacks/tabs.py
Commit message: Fix multiple Cross-Site Scripting (XSS) vulnerabilities.

 * Ensure user emails are properly escaped

User emails in the Users and Groups panel are being passed through the
urlize filter to transform them into clickable links. However, urlize
expects input to be already escaped and safe. We should make sure to
escape the strings first as email addresses are not validated and can
contain any type of string.

Closes-Bug: #1320235

 * Ensure network names are properly escaped in the Launch Instance menu

Closes-Bug: #1322197

 * Escape the URLs generated for the Horizon tables

When generating the Horizon tables, there was an assumption that only
the anchor text needed to be escaped. However some URLs are generated
based on user-provided data and should be escaped as well. Also escape
the link attributes for good measure.

 * Use 'reverse' to generate the Resource URLs in the stacks tables

Closes-Bug: #1308727

Change-Id: Ic8a92e69f66c2d265a802f350e30f091181aa42e


Vulnerable code:
        name:$this.text().replace(/^\s+/,""),
                             (self.url, link_classes, escape(unicode(data))))
                          filters=[defaultfilters.urlize])
                                   defaultfilters.urlize))
                                     link=lambda d: d.resource_name,)
                                     link=lambda d: d.resource_name)

Fixed code:
      var name = $this.text().replace(/^\s+/,"")
                             .replace(/&/g, '&amp;')
                             .replace(/</g, '&lt;')
                             .replace(/>/g, '&gt;')
                             .replace(/"/g, '&quot;')
                             .replace(/'/g, '&#x27;')
                             .replace(/\//g, '&#x2F;');
        name:name,
                             (escape(self.url),
                              escape(link_classes),
                              escape(unicode(data))))
                          filters=[defaultfilters.escape,
                                   defaultfilters.urlize])
                                   defaultfilters.escape,
                                   defaultfilters.urlize)
                          )
def get_resource_url(obj):
    return urlresolvers.reverse('horizon:project:stacks:resource',
                                args=(obj.stack_id, obj.resource_name))


                                     link=get_resource_url)
                                     link=get_resource_url)
            # The stack id is needed to generate the resource URL.
            for event in events:
                event.stack_id = stack.id
            # The stack id is needed to generate the resource URL.
            for r in resources:
                r.stack_id = stack.id