CVE-2024-41122: Go.woodpecker ci.org/woodpecker/v2 Woodpecker's Custom Environment Variables Allow Vulnerability
MODERATECVE-2024-41122 is a MODERATE (CVSS 7.5) woodpecker's custom environment variables allow vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Go.woodpecker ci.org/woodpecker/v2 libraries in the Go ecosystem. The issue involves woodpecker's custom environment variables allow to alter execution flow of plugins. Remediation is available by upgrading affected packages to version 2.7.0.
CVE-2024-41122 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-41122
To remediate this vulnerability, upgrade all affected Go.woodpecker ci.org/woodpecker/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade go.woodpecker-ci.org/woodpecker/v2 to 2.7.0
Upgrade go.woodpecker-ci.org/woodpecker to 2.7.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for go.woodpecker-ci.org/woodpecker/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-41122, inspect your project dependencies for Go.woodpecker ci.org/woodpecker/v2:
inspect dependencies for go.woodpecker-ci.org/woodpecker/v2
Analyze the terminal output to locate any version of Go.woodpecker ci.org/woodpecker/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Go.woodpecker ci.org/woodpecker/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-41122 Affected Go.woodpecker ci.org/woodpecker/v2 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
go.woodpecker-ci.org/woodpecker/v2
|
Go |
< 2.7.0
|
2.7.0
|
|
go.woodpecker-ci.org/woodpecker
|
Go |
< 2.7.0
|
2.7.0
|
References
Frequently Asked Questions
What is CVE-2024-41122?
Which Go.woodpecker ci.org/woodpecker/v2 versions are affected?
What version fixes CVE-2024-41122?
Is go.woodpecker-ci.org/woodpecker/v2 affected?
Is go.woodpecker-ci.org/woodpecker affected?
What is the CVSS score of CVE-2024-41122?
What CWE is associated with CVE-2024-41122?
How can I check Go dependencies for CVE-2024-41122?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3wf2-2pq4-4rvc",
"modified" : "2024-11-18T16:26:54Z",
"published" : "2024-07-19T19:59:06Z",
"aliases" : [ "CVE-2024-41122" ],
"summary" : "Woodpecker's custom environment variables allow to alter execution flow of plugins",
"details" : "### Impact\nThe server allow to create any user who can trigger a pipeline run malicious workflows:\n- Those workflows can either lead to a host takeover that runs the agent executing the workflow.\n- Or allow to extract the secrets who would be normally provided to the plugins who's entrypoint are overwritten.\n\n### Patches\nhttps://github.com/woodpecker-ci/woodpecker/pull/3909\nhttps://github.com/woodpecker-ci/woodpecker/pull/3934\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n**Enable the \"gated\" repo feature and review each change upfront of running**\n\n### References\n- https://github.com/woodpecker-ci/woodpecker/pull/3909\n- https://github.com/woodpecker-ci/woodpecker/pull/3934\n- https://github.com/woodpecker-ci/woodpecker-security/issues/10 (info will be published later at https://github.com/woodpecker-ci/woodpecker/issues/3929)\n- https://github.com/woodpecker-ci/woodpecker/issues/3929 (info will be published later once we got adoption of the update)\n\n### Credits\n\n- Daniel Kilimnik [@D_K_Dev](https://x.com/D_K_Dev) (Neodyme AG)\n- Felipe Custodio Romero [@_localo_](https://x.com/_localo_) (Neodyme AG)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "go.woodpecker-ci.org/woodpecker/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.7.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "go.woodpecker-ci.org/woodpecker"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.7.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker/security/advisories/GHSA-3wf2-2pq4-4rvc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41122"
}, {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker-security/issues/10"
}, {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker/issues/3929"
}, {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker/pull/3909"
}, {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker/pull/3934"
}, {
"type" : "WEB",
"url" : "https://github.com/woodpecker-ci/woodpecker/commit/8aa3e5ec82c92eca3279e4be68625111eeedf1c4"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/woodpecker-ci/woodpecker"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-2998"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-19T19:59:06Z",
"nvd_published_at" : "2024-07-19T20:15:08Z"
}
}