Security advisory
OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, there is a critical vulnerability which may lead to arbitrary file read. When BuildSpec is provided in XML format, the spec is processed by XmlBuildSpecMigrator.migrate(buildSpecString); which processes the XML document without preventing the expansion of external entities. These entities can be configured to read arbitrary files from the file system and dump their contents in the final XML document to be migrated. If the files are dumped in properties included in the YAML file, it will be possible for an attacker to read them. If not, it is possible for an attacker to exfiltrate the contents of these files Out Of Band. This issue was addressed in 4.0.3 by ignoring ENTITY instructions in xml file.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-21250
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 12:45 UTC · Revision 1
Source evidence
OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, there is a critical vulnerability which may lead to arbitrary file read. When BuildSpec is provided in XML format, the spec is processed by XmlBuildSpecMigrator.migrate(buildSpecString); which processes the XML document without preventing the expansion of external entities. These entities can be configured to read arbitrary files from the file system and dump their contents in the final XML document to be migrated. If the files are dumped in properties included in the YAML file, it will be possible for an attacker to read them. If not, it is possible for an attacker to exfiltrate the contents of these files Out Of Band. This issue was addressed in 4.0.3 by ignoring ENTITY instructions in xml file.
osv:CVE-2021-21250
Complete source record
{
"id": "27e75889186032faad58e9feea75b716f3962ebacaead2fddd86accac5dc9329",
"url": "https://osv.dev/vulnerability/CVE-2021-21250",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-21250",
"summary": "OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, there is a critical vulnerability which may lead to arbitrary file read. When BuildSpec is provided in XML format, the spec is processed by XmlBuildSpecMigrator.migrate(buildSpecString); which processes the XML document without preventing the expansion of external entities. These entities can be configured to read arbitrary files from the file system and dump their contents in the final XML document to be migrated. If the files are dumped in properties included in the YAML file, it will be possible for an attacker to read them. If not, it is possible for an attacker to exfiltrate the contents of these files Out Of Band. This issue was addressed in 4.0.3 by ignoring ENTITY instructions in xml file.",
"evidence": "osv:CVE-2021-21250",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-21250",
"aliases": [
"CVE-2021-21250",
"GHSA-9pph-8gfc-6w2r"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/theonedev/onedev",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "4bd71941974a1b077e955616d7ba3da6fd21670c"
},
{
"fixed": "9196fd795e87dab069b4260a3590a0ea886e770f"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:onedev_project:onedev:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "4.0.3"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "9196fd795e87dab069b4260a3590a0ea886e770f"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v4.0.1",
"v4.0.0",
"v3.2.4",
"v3.2.3",
"v3.2.2",
"v3.2.1",
"v3.2.0",
"v3.1.2",
"v3.1.1",
"v3.1.0",
"v3.0.10",
"v3.0.9",
"v3.0.8",
"v3.0.7",
"v3.0.6",
"v3.0.5",
"v3.0.4",
"2.0.5",
"2.0.4",
"2.0.0",
"2.0-beta-build120",
"2.0-beta-build119"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21250.json",
"vanir_signatures": [
{
"id": "CVE-2021-21250-5b18a10a",
"digest": {
"threshold": 0.9,
"line_hashes": [
"182484563874193169262834834994976916016",
"289174475564481253677929928361332830260",
"264504359361467511417473596478260675935",
"305381516352905006677276489729406894925",
"214830405763575437575469211062676769474",
"316679561811269259889218992684740886746",
"287848540106102445617926140352959793313",
"247192414775238100131917048291631763895",
"207566769440661851117086970821772353373"
]
},
"source": "https://github.com/theonedev/onedev/commit/9196fd795e87dab069b4260a3590a0ea886e770f",
"target": {
"file": "server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-21250-dbf8c217",
"digest": {
"length": 1837,
"function_hash": "241560122628008943930647365049276241122"
},
"source": "https://github.com/theonedev/onedev/commit/9196fd795e87dab069b4260a3590a0ea886e770f",
"target": {
"file": "server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java",
"function": "migrate"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
}
],
"vanir_signatures_modified": "2026-10-20T14:28:02Z"
}
}
],
"modified": "2026-10-20T14:28:02.236529482Z",
"provider": "osv",
"references": [
"https://github.com/theonedev/onedev/security/advisories/GHSA-9pph-8gfc-6w2r",
"https://github.com/theonedev/onedev/commit/9196fd795e87dab069b4260a3590a0ea886e770f"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-21250",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 388999,
"published_at": "2021-01-15T21:15:13.803+00:00"
}