mirror of
https://github.com/calesthio/OpenMontage.git
synced 2026-08-05 15:20:40 +08:00
fix: sanitize os.system() shell injection in manimgl scene templates
os.system(f"manimgl {__file__} ClassName") interpolates the script's own
path into a shell string. These templates are meant to be copied and
renamed per-scene by an agent, so a scene/folder name containing shell
metacharacters is a real injection path, not just malformed input.
Switched to subprocess.run() with an argument list (no shell=True), so
there's nothing left for a shell to interpret regardless of what the
path contains. Same fix applied in both duplicate locations
(.claude/skills and .agents/skills) since the files are identical.
Reviewed scripts/lib/tts.mjs's child_process usage as part of the same
report -- not included in this PR, it already passes args as a real
array with no shell:true anywhere in the call chain, so it isn't
actually exploitable.
This commit is contained in:
@@ -254,5 +254,5 @@ class LightingTemplate(Scene):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
os.system(f"manimgl {__file__} ThreeDSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "ThreeDSceneTemplate"])
|
||||
|
||||
@@ -130,5 +130,5 @@ class AnimationShowcase(Scene):
|
||||
if __name__ == "__main__":
|
||||
# This allows you to run: python basic_scene.py
|
||||
# (though using manimgl is recommended)
|
||||
import os
|
||||
os.system(f"manimgl {__file__} BasicSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "BasicSceneTemplate"])
|
||||
|
||||
@@ -329,5 +329,5 @@ class MatrixTemplate(Scene):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
os.system(f"manimgl {__file__} MathSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "MathSceneTemplate"])
|
||||
|
||||
@@ -254,5 +254,5 @@ class LightingTemplate(Scene):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
os.system(f"manimgl {__file__} ThreeDSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "ThreeDSceneTemplate"])
|
||||
|
||||
@@ -130,5 +130,5 @@ class AnimationShowcase(Scene):
|
||||
if __name__ == "__main__":
|
||||
# This allows you to run: python basic_scene.py
|
||||
# (though using manimgl is recommended)
|
||||
import os
|
||||
os.system(f"manimgl {__file__} BasicSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "BasicSceneTemplate"])
|
||||
|
||||
@@ -329,5 +329,5 @@ class MatrixTemplate(Scene):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
os.system(f"manimgl {__file__} MathSceneTemplate")
|
||||
import subprocess
|
||||
subprocess.run(["manimgl", __file__, "MathSceneTemplate"])
|
||||
|
||||
Reference in New Issue
Block a user