PT-2022-24807 · Onedev · Onedev
Robinshine
·
Published
2022-09-13
·
Updated
2023-07-13
·
CVE-2022-39207
5.4
Medium
Base vector | Vector | AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Name of the Vulnerable Software and Affected Versions:
Onedev versions prior to 7.3.0
Description:
Onedev is an open source, self-hosted Git Server with CI/CD and Kanban. During CI/CD builds, it is possible to save build artifacts for later retrieval. These artifact files are served by the webserver in the same context as the UI without any further restrictions. This leads to Cross-Site Scripting (XSS) when a user creates a build artifact that contains HTML. When accessing the artifact, the content is rendered by the browser, including any JavaScript that it contains. Since all cookies (except for the rememberMe one) do not set the HttpOnly flag, an attacker could steal the session of a victim and use it to impersonate them. To exploit this issue, attackers need to be able to modify the content of artifacts, which usually means they need to be able to modify a project's build spec. The exploitation requires the victim to click on an attacker's link. It can be used to elevate privileges by targeting admins of a OneDev instance. In the worst case, this can lead to arbitrary code execution on the server, because admins can create Server Shell Executors and use them to run any command on the server.
Recommendations:
For versions prior to 7.3.0, upgrade to version 7.3.0 or later to resolve the issue. As a temporary workaround, consider restricting access to build artifacts and limiting the ability to modify project build specs to trusted users only. Avoid clicking on links from untrusted sources, especially those that may lead to build artifacts.
Exploit
Fix
XSS
Incorrect Permission
Related Identifiers
Affected Products
References · 7
- 🔥 https://blog.sonarsource.com/onedev-remote-code-execution · Exploit
- https://github.com/theonedev/onedev/commit/adb6e31476621f824fc3227a695232df830d83ab⭐ 13421 🔗 862 · Patch
- https://osv.dev/vulnerability/CVE-2022-39207 · Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2022-39207 · Security Note
- https://github.com/theonedev/onedev/security/advisories/GHSA-27fw-gv88-qrpg⭐ 13421 🔗 862 · Note
- https://t.me/cibsecurity/49710 · Telegram Post
- https://t.me/cvenotify/54290 · Telegram Post