mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-22 11:58:46 +00:00
test: assert domain payload never parses as a shell operator (drop literal check)
quote() legitimately wraps the payload text inside single quotes, so the raw substring is present but inert. leaksShellSyntax (via shell-quote parse) is the correct assertion; the literal not.toContain check was wrong.
This commit is contained in:
@@ -50,8 +50,9 @@ describe("writeDomainsToCompose error path (GHSA-xmmr serviceName injection)", (
|
|||||||
|
|
||||||
// The service does not exist in the compose, so we hit the error branch.
|
// The service does not exist in the compose, so we hit the error branch.
|
||||||
expect(result).toContain("Has occurred an error");
|
expect(result).toContain("Has occurred an error");
|
||||||
|
// The payload text may appear inside the single-quoted echo argument, but
|
||||||
|
// it must never parse as a shell operator ($(), backtick, ; …).
|
||||||
expect(leaksShellSyntax(result, "touch")).toBe(false);
|
expect(leaksShellSyntax(result, "touch")).toBe(false);
|
||||||
expect(result).not.toContain("$(touch");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("neutralizes backtick and semicolon payloads too", async () => {
|
it("neutralizes backtick and semicolon payloads too", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user