CVE-2014-125070: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability has been found in yanheven console and classified as problematic. Affected by this vulnerability is the function get_zone_hosts/AvailabilityZonesTable of the file openstack_dashboard/dashboards/admin/aggregates/tables.py. The manipulation leads to cross site scripting. The attack can be launched remotely. The patch is named ba908ae88d5925f4f6783eb234cc4ea95017472b. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-217651.
CWE description: 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.
CVSS v3 base score: 6.1
Published: 2023-01-08T18:15Z
Repository: https://github.com/yanheven/console
Language: Python
Files changed: openstack_dashboard/dashboards/admin/aggregates/tables.py
Commit date: 2014-08-19 15:28:52 +0100
Commit message: Fix XSS issue with the unordered_list filter

When using the unordered_list filter in a Horizon table (as opposed to
a template directly), autoescaping is not set by default and the input
wasn't sanitised.

Closes-Bug: #1349491
Change-Id: Id82eefe48ccb17a158751ec65d24f3ac779380ec

Diff: diff --git a/openstack_dashboard/dashboards/admin/aggregates/tables.py b/openstack_dashboard/dashboards/admin/aggregates/tables.py
index 5cefae10..f0c21229 100644
--- a/openstack_dashboard/dashboards/admin/aggregates/tables.py
+++ b/openstack_dashboard/dashboards/admin/aggregates/tables.py
@@ -91,22 +91,26 @@ def get_zone_hosts(zone):
         up = _("Services Up") if up else _("Services Down")
         host_details.append("%(host)s (%(up)s)" % {'host': name, 'up': up})
     return host_details
 
 
+def safe_unordered_list(value):
+    return filters.unordered_list(value, autoescape=True)
+
+
 class HostAggregatesTable(tables.DataTable):
     name = tables.Column('name', verbose_name=_('Name'))
     availability_zone = tables.Column('availability_zone',
                                       verbose_name=_('Availability Zone'))
     hosts = tables.Column(get_aggregate_hosts,
                           verbose_name=_("Hosts"),
                           wrap_list=True,
-                          filters=(filters.unordered_list,))
+                          filters=(safe_unordered_list,))
     metadata = tables.Column(get_metadata,
                              verbose_name=_("Metadata"),
                              wrap_list=True,
-                             filters=(filters.unordered_list,))
+                             filters=(safe_unordered_list,))
 
     class Meta:
         name = "host_aggregates"
         verbose_name = _("Host Aggregates")
         table_actions = (AggregateFilterAction,
@@ -121,11 +125,11 @@ class AvailabilityZonesTable(tables.DataTable):
     name = tables.Column('zoneName',
                          verbose_name=_('Availability Zone Name'))
     hosts = tables.Column(get_zone_hosts,
                           verbose_name=_('Hosts'),
                           wrap_list=True,
-                          filters=(filters.unordered_list,))
+                          filters=(safe_unordered_list,))
     available = tables.Column(get_available,
                               verbose_name=_('Available'),
                               status=True,
                               filters=(filters.yesno, filters.capfirst))
 

Vulnerable code:                           filters=(filters.unordered_list,))
                             filters=(filters.unordered_list,))
                          filters=(filters.unordered_list,))
Fixed code: def safe_unordered_list(value):
    return filters.unordered_list(value, autoescape=True)


                          filters=(safe_unordered_list,))
                             filters=(safe_unordered_list,))
                          filters=(safe_unordered_list,))