Skip to content

Malicious links can be crafted by users and shown in the UI

Critical
enekofb published GHSA-378h-hpjp-gxfc Aug 24, 2022

Package

No package listed

Affected versions

From v0.7.0-rc.1 to v0.9.0-rc.4

Patched versions

v0.9.0-rc.5

Description

Impact

Unpatched versions of Weave GitOps Enterprise are vulnerable to a cross-site scripting (XSS) bug allowing a malicious user to inject a javascript: link in the UI. When clicked by a victim user, the script will execute with the victim's permission.

The exposure appears in Weave GitOps Enterprise UI via a GitopsCluster dashboard link. An annotation can be added to a GitopsCluster custom resource.

apiVersion: gitops.weave.works/v1alpha1
kind: GitopsCluster
metadata:
  name: demo-02
  namespace: default
  annotations:
    metadata.weave.works/dashboard.hellothere: "javascript:alert('hello there ' + window.localStorage.getItem('name'));"

The attacker does not need access to the Weave GitOps UI to craft an attack, access to a Git repository that contains resources that are displayed is all that is needed.

Patches

v0.9.0-rc.5

Workarounds

Given that the exposure comes from modifications done in GitopsCluster objects, the mitigation comes around establishing the controls to avoid that an attacker could modify them.

  1. Via Git, by ensuring that no modifications to GitopsCluster are done without review or control that avoids it.
  2. Via Kubernetes API, by ensuring that access to GitopsCluster resources is properly protected via RBAC.

References

https://docs.gitops.weave.works/docs/next/cluster-management/getting-started/#profiles-and-clusters

For more information

If you have any questions or comments about this advisory:

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

No CWEs