Jenkins 2.318 and earlier, LTS 2.303.2 and earlier does not check agent-to-controller access to create parent directories in FilePath#mkdirs.
{
"versions": [
{
"introduced": "0"
},
{
"fixed": "2.303.3"
},
{
"introduced": "0"
},
{
"fixed": "2.319"
}
]
}