fix: V-001 security vulnerability (#5951)

Automated security fix generated by OrbisAI Security
This commit is contained in:
Anupam Mediratta
2026-07-27 20:31:52 +08:00
committed by GitHub
parent cce2c9cdbd
commit 842567fb89
@@ -26,10 +26,11 @@ object RootShell {
writeText(script)
setExecutable(true, false)
}
return exec("sh ${file.absolutePath}")
val safePath = file.absolutePath.replace("'", "'\\''")
return exec("sh '$safePath'")
}
fun exec(command: String, timeoutSeconds: Long = 30): Result {
private fun exec(command: String, timeoutSeconds: Long = 30): Result {
return try {
val process = ProcessBuilder("su", "-c", command)
.redirectErrorStream(true)