@evomap/evolver 1.69.0 → 1.69.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -787,9 +787,30 @@ async function main() {
787
787
  const data = await resp.json();
788
788
  const outFlag = args.find(a => typeof a === 'string' && a.startsWith('--out='));
789
789
  const safeId = String(data.skill_id || skillId).replace(/[^a-zA-Z0-9_\-\.]/g, '_');
790
- const outDir = outFlag
791
- ? outFlag.slice('--out='.length)
792
- : path.join('.', 'skills', safeId);
790
+ let outDir;
791
+ if (outFlag) {
792
+ const rawOut = outFlag.slice('--out='.length);
793
+ if (!rawOut || rawOut.trim() === '') {
794
+ console.error('[fetch] --out= value cannot be empty');
795
+ process.exit(1);
796
+ }
797
+ const resolvedOut = path.resolve(process.cwd(), rawOut);
798
+ const cwd = path.resolve(process.cwd());
799
+ const rel = path.relative(cwd, resolvedOut);
800
+ // Reject paths that escape the current working directory or are
801
+ // absolute on a different volume/root. This prevents --out=../../etc
802
+ // from writing outside the project tree.
803
+ if (rel.startsWith('..') || path.isAbsolute(rel)) {
804
+ console.error('[fetch] --out= must resolve to a path inside the current working directory');
805
+ console.error(' Provided: ' + rawOut);
806
+ console.error(' Resolved: ' + resolvedOut);
807
+ console.error(' Workdir: ' + cwd);
808
+ process.exit(1);
809
+ }
810
+ outDir = resolvedOut;
811
+ } else {
812
+ outDir = path.join('.', 'skills', safeId);
813
+ }
793
814
 
794
815
  if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
795
816
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver",
3
- "version": "1.69.0",
3
+ "version": "1.69.3",
4
4
  "description": "A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.",
5
5
  "main": "index.js",
6
6
  "bin": {