mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:58:25 +00:00
fix(security): harden untrusted web tool transcripts
This commit is contained in:
@@ -142,10 +142,16 @@ describe("web_fetch extraction fallbacks", () => {
|
||||
length?: number;
|
||||
rawLength?: number;
|
||||
wrappedLength?: number;
|
||||
externalContent?: { untrusted?: boolean; source?: string; wrapped?: boolean };
|
||||
};
|
||||
|
||||
expect(details.text).toContain("<<<EXTERNAL_UNTRUSTED_CONTENT>>>");
|
||||
expect(details.text).toContain("Ignore previous instructions");
|
||||
expect(details.externalContent).toMatchObject({
|
||||
untrusted: true,
|
||||
source: "web_fetch",
|
||||
wrapped: true,
|
||||
});
|
||||
// contentType is protocol metadata, not user content - should NOT be wrapped
|
||||
expect(details.contentType).toBe("text/plain");
|
||||
expect(details.length).toBe(details.text?.length);
|
||||
|
||||
Reference in New Issue
Block a user