{"record":{"id":"de6332407e9420f1","repo":"JuliusBrussee/caveman","slug":"fixture-path-escapes-root-q","errorCode":null,"errorMessage":"fixture path escapes root: %q","messagePattern":"fixture path escapes root: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/evals/harness.go","lineNumber":140,"sourceCode":"\t}\n\tvar m Manifest\n\tif err := yaml.Unmarshal(manifestRaw, &m); err != nil {\n\t\treturn Report{}, fmt.Errorf(\"parse manifest: %w\", err)\n\t}\n\tif len(m.Fixtures) == 0 {\n\t\treturn Report{}, fmt.Errorf(\"manifest has no fixtures\")\n\t}\n\tread := func(name string) ([]byte, error) {\n\t\tif !fs.ValidPath(name) || name == \".\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid fixture path %q\", name)\n\t\t}\n\t\tcandidate, err := filepath.EvalSymlinks(filepath.Join(resolvedRoot, filepath.FromSlash(name)))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trel, err := filepath.Rel(resolvedRoot, candidate)\n\t\tif err != nil || rel == \"..\" || strings.HasPrefix(rel, \"..\"+string(filepath.Separator)) {\n\t\t\treturn nil, fmt.Errorf(\"fixture path escapes root: %q\", name)\n\t\t}\n\t\treturn os.ReadFile(candidate)\n\t}\n\treturn RunManifest(m, read)\n}\n\n// RunWithQuality replays the embedded fixture set and also sends baseline and\n// compressed prompts through a model runner before grading the answers.\nfunc RunWithQuality(ctx context.Context, opts QualityOptions) (Report, error) {\n\tm, err := EmbeddedManifest()\n\tif err != nil {\n\t\treturn Report{}, err\n\t}\n\tread := func(name string) ([]byte, error) {\n\t\treturn fixturesFS.ReadFile(\"fixtures/\" + name)\n\t}\n\treturn RunManifestWithQuality(ctx, m, read, opts)\n}","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/evals/harness.go#L122-L158","documentation":"Raised by the fixture reader closure in RunDir: after resolving symlinks, the referenced file lands outside the fixture root (Rel produced '..' or a non-subtree path). This confines fixture access to root even through symlinks — a security guard, not a mere typo check.","triggerScenarios":"Thrown at engine/evals/harness.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove symlink entries that point outside the fixture root","Copy the referenced file inside root and update the manifest","Repoint the manifest path to a file that lives under root"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}