Relationships
#941 coerceToSuffix does not sanitize path-unsafe characters, causing forEach items and vary dimensions with / to produce invalid data instance names
Opened by jeremy · 7/3/2026· Shipped 7/3/2026
When a workflow forEach loop iterates over strings containing / (e.g. GitLab repo paths like o11n/macos-runner), the coerceToSuffix function in src/domain/workflows/data_suffix.ts returns the value verbatim via String(val). This unsanitized string is then used in two places:
dataOutputOverrides vary suffix (execution_service.ts → data_writer.ts):
instanceName =
${instanceName}-${override.resolvedVarySuffix}; // → "scan-o11n/macos-runner"The data repository rejects this with: Data name must not contain '..', '/', '', or null bytes (path traversal).
reportVarySuffix (execution_service.ts line ~1132) — same unsanitized value used to namespace the @swamp/method-summary report, producing the same validation failure: Report @swamp/method-summary failed: Data name must not contain '/', ....
The scan resource itself succeeds if the extension's writeResource call manually sanitizes the name (e.g. projectPath.replaceAll("/", "--")), but that sanitization is not applied at the workflow layer.
Suggested fix: In coerceToSuffix, after String(val), apply the same sanitization the data repository enforces — replace /, , null bytes, and .. with a safe alternative (e.g. --):
export function coerceToSuffix(val: unknown): string { // ... existing object handling ... return String(val) .replace(/../g, "--") .replace(/[/\]/g, "--") .replace(/\0/g, ""); }
Reproduction: A forEach workflow step iterating over GitLab repo paths (format group/repo) with any dataOutputOverrides.vary referencing an input containing the path, or simply examining the step display name in the workflow run summary table.
Shipped
Click a lifecycle step above to view its details.