You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Medium] Automation re-export doesn't verify the target stays inside the automations root #17
Compare with the skill builder, which validates containment via an isInside(...) check (electron/skillbuilder/builder.ts:282).
Mechanism
On re-export, the target directory is derived from path.dirname(prior.exportedPath), where prior comes from previously persisted automation data. That value is used to mkdirSync + writeFileSync(automation.json)without verifying it still resolves inside automationsRoot(). A tampered/relocated exportedPath writes outside the intended root.
Impact
automation.json can be written outside the automations root (arbitrary-ish write within the user's permissions).
Suggested fix
Before writing, assert the resolved dir is inside automationsRoot() (reuse the skill builder's isInside containment check); otherwise fall back to a fresh in-root directory.
Regression test to add (npm test)
Unit test: seed a persisted automation whose exportedPath points outside root (e.g. via ..), call the export, and assert it refuses / rewrites inside root. Deterministic; not an evals/ concern.
Activity
fix: verify automation re-export path stays inside the automations root