CVE-2016-15036 (published 2023-12-23T20:15Z)

** UNSUPPORTED WHEN ASSIGNED ** A vulnerability was found in Deis Workflow Manager up to 2.3.2. It has been classified as problematic. This affects an unknown part. The manipulation leads to race condition. The complexity of an attack is rather high. The exploitability is told to be difficult. Upgrading to version 2.3.3 is able to address this issue. The patch is named 31fe3bccbdde134a185752e53380330d16053f7f. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-248847. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.

CVSS v3 base score: 7.5, HIGH (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-362
cwe_name: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
description: The product contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
extended_description: 
            This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
            A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
            A race condition violates these properties, which are closely related:
               
                  Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
                  Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
               
            A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
            The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the product; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable product.
         
         

Fix information:
repo_url: https://github.com/deis/workflow-manager
commit_details: repo_url: https://github.com/deis/workflow-manager
author: Jack Francis
author_date: 2016-08-11 14:54:43-07:00
msg: cluster_id is vulnerable to race condition when called concurrently (#94)

* fix(cluster_id): Get() is "insert if not exist", needs read-write lock protection

* fix(jobs): remove static clusterID getter in sendVersionsImpl

1) add generic data.ClusterID type in sendVersions type struct
2) enable common clusterID reference to be included in multiple, concurrent jobs, so that appropriate locking can be enforced
repository: repo_url: https://github.com/deis/workflow-manager
repo_name: deis/workflow-manager
description: Deis Workflow Manager: Cluster First Aid
repo_language: Go
owner: deis
file_changes: filename: boot.go
change_type: ModificationType.MODIFY
diff: @@ -47,6 +47,7 @@ func main() {
 
 	svPeriodic := jobs.NewSendVersionsPeriodic(
 		apiClient,
+		clusterID,
 		deisK8sResources,
 		availableVersion,
 		pollDur,

programming_language: Go
filename: cluster_id.go
change_type: ModificationType.MODIFY
diff: @@ -51,6 +51,8 @@ func NewClusterIDFromPersistentStorage(sgc k8s.KubeSecretGetterCreator) ClusterI
 
 // Get is the ClusterID interface implementation
 func (c clusterIDFromPersistentStorage) Get() (string, error) {
+	c.rwm.Lock()
+	defer c.rwm.Unlock()
 	secret, err := c.secretGetterCreator.Get(wfmSecretName)
 	//If we don't have the secret we shouldn't be returning error and instead a create a new one
 	if err != nil && !apierrors.IsNotFound(err) {

programming_language: Go
filename: jobs.go
change_type: ModificationType.MODIFY
diff: @@ -22,6 +22,7 @@ type Periodic interface {
 // SendVersions fulfills the Periodic interface
 type sendVersions struct {
 	k8sResources      *k8s.ResourceInterfaceNamespaced
+	clusterID         data.ClusterID
 	apiClient         *apiclient.WorkflowManager
 	availableVersions data.AvailableVersions
 	frequency         time.Duration
@@ -30,12 +31,14 @@ type sendVersions struct {
 // NewSendVersionsPeriodic creates a new SendVersions using sgc and rcl as the the secret getter / creator and replication controller lister implementations (respectively)
 func NewSendVersionsPeriodic(
 	apiClient *apiclient.WorkflowManager,
+	clusterID data.ClusterID,
 	ri *k8s.ResourceInterfaceNamespaced,
 	availableVersions data.AvailableVersions,
 	frequency time.Duration,
 ) Periodic {
 	return &sendVersions{
 		k8sResources:      ri,
+		clusterID:         clusterID,
 		apiClient:         apiClient,
 		availableVersions: availableVersions,
 		frequency:         frequency,
@@ -45,7 +48,7 @@ func NewSendVersionsPeriodic(
 // Do is the Periodic interface implementation
 func (s sendVersions) Do() error {
 	if config.Spec.CheckVersions {
-		err := sendVersionsImpl(s.apiClient, s.k8sResources, s.availableVersions)
+		err := sendVersionsImpl(s.apiClient, s.clusterID, s.k8sResources, s.availableVersions)
 		if err != nil {
 			return err
 		}
@@ -135,12 +138,13 @@ func DoPeriodic(pSlice []Periodic) chan<- struct{} {
 //  sendVersions sends cluster version data
 func sendVersionsImpl(
 	apiClient *apiclient.WorkflowManager,
+	clusterID data.ClusterID,
 	k8sResources *k8s.ResourceInterfaceNamespaced,
 	availableVersions data.AvailableVersions,
 ) error {
 	cluster, err := data.GetCluster(
 		data.NewInstalledDeisData(k8sResources),
-		data.NewClusterIDFromPersistentStorage(k8sResources.Secrets()),
+		clusterID,
 		data.NewLatestReleasedComponent(k8sResources, availableVersions),
 	)
 	if err != nil {

programming_language: Go