{"record":{"id":"8b3a183b529e2bfb","repo":"abhigyanpatwari/GitNexus","slug":"compound-engineering-plugin-entries-must-not-be-sy","errorCode":null,"errorMessage":"Compound Engineering plugin entries must not be symlinks: {entry.path}","messagePattern":"Compound Engineering plugin entries must not be symlinks: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":327,"sourceCode":"    if not skills.exists():\n        raise SandboxError(f\"Compound Engineering plugin skills directory is missing: {skills}\")\n\n    def walk(directory: Path, relative_dir: PurePosixPath) -> Iterator[tuple[PurePosixPath, Path]]:\n        try:\n            with os.scandir(directory) as scanned:\n                entries = sorted(scanned, key=lambda entry: entry.name)\n        except OSError as exc:\n            raise SandboxError(f\"Compound Engineering plugin directory is unreadable: {directory}: {exc}\") from exc\n        for entry in entries:\n            relative = relative_dir / entry.name\n            if _is_forbidden_plugin_path(relative):\n                continue\n            try:\n                metadata = entry.stat(follow_symlinks=False)\n            except OSError as exc:\n                raise SandboxError(f\"Compound Engineering plugin entry is unreadable: {entry.path}: {exc}\") from exc\n            if stat.S_ISLNK(metadata.st_mode):\n                raise SandboxError(f\"Compound Engineering plugin entries must not be symlinks: {entry.path}\")\n            if stat.S_ISDIR(metadata.st_mode):\n                yield from walk(Path(entry.path), relative)\n            elif stat.S_ISREG(metadata.st_mode):\n                yield relative, Path(entry.path)\n            else:\n                raise SandboxError(f\"Compound Engineering plugin entries must be regular files: {entry.path}\")\n\n    for name in _ALLOWED_PLUGIN_DIRS:\n        directory = source / name\n        if not directory.exists():\n            continue\n        try:\n            metadata = directory.lstat()\n        except OSError as exc:\n            raise SandboxError(f\"Compound Engineering plugin component is unreadable: {directory}: {exc}\") from exc\n        if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):\n            raise SandboxError(f\"Compound Engineering plugin component must be a real directory: {directory}\")\n        yield from walk(directory, PurePosixPath(name))","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L309-L345","documentation":"walk() rejects any entry whose lstat mode is a symlink (stat.S_ISLNK). Symlinks anywhere under skills/, scripts/, or assets/ are forbidden because they can escape the bounded source and create TOCTOU windows during the snapshot copy.","triggerScenarios":"Any file (or directory) inside skills/, scripts/, or assets/ is a symbolic link — e.g., scripts/postinstall.sh -> /usr/local/bin/foo, or skills/ce-plan -> ../shared/ce-plan.","commonSituations":"Plugin shipped from a monorepo that used symlinks for shared code; operator symlinked for convenience; build tool that created symlinks for assets.","solutions":["Find symlinks: `find <plugin_dir>/{skills,scripts,assets} -type l`.","Dereference them in place: `cp -rL --remove-destination <plugin_dir> <plugin_dir_real>` (then validate).","Re-tar the plugin with `tar -czh` (dereference at archive time) and re-extract."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef no_symlinks_in_plugin(source: Path) -> bool:\n    for name in (\"skills\", \"scripts\", \"assets\"):\n        d = source / name\n        if not d.exists():\n            continue\n        for p in d.rglob(\"*\"):\n            if p.is_symlink():\n                return False\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    list(_plugin_files(source))\nexcept SandboxError as exc:\n    if \"must not be symlinks\" in str(exc):\n        # dereference: cp -rL into a clean directory\n        ...\n    raise","preventionTips":["Ship plugins as dereferenced tarballs (`tar -czh`).","Run `find <plugin>/{skills,scripts,assets} -type l` as a pre-flight check."],"tags":["symlink-guard","ce-plugin","sandbox","filesystem"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}