Skip to content

GHSA-77cr-6gr8-7rr9 CVE-2020-27195 GO-2022-0806

Use After Free in HashiCorp Nomad

Critical Go
Severity
9.1 / 10
Critical · CVSS 3.1
Exploit chance (EPSS)
1.49%
Chance of exploitation in the next 30 days. Higher than 74.12% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-416 Use After Free
Fix
0.10.6
Upgrade github.com/hashicorp/nomad to this version or later

Description

HashiCorp Nomad and Nomad Enterprise version 0.9.0 up to 0.12.5 client file sandbox feature can be subverted using either the template or artifact stanzas. Fixed in 0.12.6, 0.11.5, and 0.10.6

Affected versions

Go

PackageVulnerableFixed in
github.com/hashicorp/nomad
>= 0.9.0, < 0.10.6
0.10.6
github.com/hashicorp/nomad
>= 0.11.0, < 0.11.5
0.11.5
github.com/hashicorp/nomad
>= 0.12.0, < 0.12.6
0.12.6
github.com/hashicorp/nomad
>= 0.9.0, < 0.10.6
>= 0.11.0, < 0.11.5
>= 0.12.0, < 0.12.6
0.10.6
0.11.5
0.12.6

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/hashicorp/nomad Go → 0.10.6

go
go get github.com/hashicorp/nomad@v0.10.6 && go mod tidy

Severity breakdown

CVSS 3.1 9.1

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Weakness

CWE-416: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

How to prevent it
  • Architecture and Design: Choose a language that provides automatic memory management.
  • Implementation: When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-hx53-77qj-8663
HashiCorp Nomad vulnerable to a path traversal
High Also affects github.com/hashicorp/nomad
GHSA-3934-423w-4jq3
HashiCorp Nomad vulnerable to symlink attack
Medium Also affects github.com/hashicorp/nomad
GHSA-rx97-6c62-55mf
Hashicorp Nomad Incorrect Privilege Assignment vulnerability
High Also affects github.com/hashicorp/nomad
GHSA-c3q9-q986-vrwh
Nomad is vulnerable to unintentional exposure of the workload identity token and client secret token in audit logs
Medium Also affects github.com/hashicorp/nomad
GHSA-hr68-hvgv-xxqf
Hashicorp Nomad Incorrect Privilege Assignment vulnerability
Medium Also affects github.com/hashicorp/nomad
GHSA-2w5v-x29g-jw7j
Hashicorp Nomad Incorrect Authorization vulnerability
High Also affects github.com/hashicorp/nomad
GHSA-25qx-vfw2-fw8r
Nomad Vulnerable to Allocation Directory Escape On Non-Existing File Paths Through Archive Unpacking
Medium Also affects github.com/hashicorp/nomad
GHSA-5mqx-rpxv-mvxj
HashiCorp Nomad is vulnerable to path escape through archive unpacking during migration
High Also affects github.com/hashicorp/nomad
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor