OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, there is a critical vulnerability involving the build endpoint parameters. InputSpec is used to define parameters of a Build spec. It does so by using dynamically generated Groovy classes. A user able to control job parameters can run arbitrary code on OneDev's server by injecting arbitrary Groovy code. The ultimate result is in the injection of a static constructor that will run arbitrary code. For a full example refer to the referenced GHSA. This issue was addressed in 4.0.3 by escaping special characters such as quote from user input.
[
{
"id": "CVE-2021-21248-0aa897d3",
"signature_type": "Line",
"source": "https://github.com/theonedev/onedev/commit/39d95ab8122c5d9ed18e69dc024870cae08d2d60",
"target": {
"file": "server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java"
},
"digest": {
"line_hashes": [
"328517268871830018930557871912003146622",
"20910458844816322456253282477776400339",
"96439450927759822255062807841622656105",
"13792724726599233070052788992702438481"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false
},
{
"id": "CVE-2021-21248-0e5cc867",
"signature_type": "Function",
"source": "https://github.com/theonedev/onedev/commit/39d95ab8122c5d9ed18e69dc024870cae08d2d60",
"target": {
"function": "getPropertyDef",
"file": "server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java"
},
"digest": {
"length": 538.0,
"function_hash": "70220704029479522527471992683922055107"
},
"signature_version": "v1",
"deprecated": false
},
{
"id": "CVE-2021-21248-3293c5b8",
"signature_type": "Line",
"source": "https://github.com/theonedev/onedev/commit/39d95ab8122c5d9ed18e69dc024870cae08d2d60",
"target": {
"file": "server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java"
},
"digest": {
"line_hashes": [
"111338269377089353463508498149491676445",
"139430799199400221570926262484523590448",
"175587402203147316825303261968781122054",
"325175320828442439627117363541638942758",
"877509100382475066525309626866558274",
"126400034584215042413127943485952889680",
"208728838931797298297312743535911880123"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false
}
]