From f8891beb0a43a907ff0bf9e757eaf79f72a16e84 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Thu, 5 Aug 2021 00:40:21 +0200 Subject: [PATCH 01/15] #2219 Frezing object to protect the prototype --- cypress/platform/knsv.html | 5 ++--- cypress/platform/xss2.html | 7 +++++++ src/utils.js | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html index 50b3c06077..510fa9f141 100644 --- a/cypress/platform/knsv.html +++ b/cypress/platform/knsv.html @@ -57,9 +57,8 @@ end
-%%{init: { '__proto__': {'vuln': 'test'}} }%% -%%{init: { '__proto__': {'vuln': 'test'}} }%% - +%%{init: { 'prototype': {'__proto__': {'vuln': 'test'}}} }%% +%%{init: { 'prototype': {'__proto__': {'vuln': 'test'}}} }%% sequenceDiagram Alice->>Bob: Hi Bob Bob->>Alice: Hi Alice diff --git a/cypress/platform/xss2.html b/cypress/platform/xss2.html index 0774023ff2..31c5302d35 100644 --- a/cypress/platform/xss2.html +++ b/cypress/platform/xss2.html @@ -44,6 +44,13 @@ graph LR A --> B
+
+ %%{init: { 'prototype': {'__proto__': {'polluted': 'test'}}} }%% + %%{init: { 'prototype': {'__proto__': {'polluted': 'test'}}} }%% + sequenceDiagram + Alice->>Bob: Hi Bob + Bob->>Alice: Hi Alice +
');\n if (idx >= 0) {\n idx += 9;\n txt = txt.substr(idx);\n }\n } else {\n rs += txt;\n idx = -1;\n break;\n }\n }\n\n rs = rs.replace(/javascript:/g, '#');\n rs = rs.replace(/onerror=/g, 'onerror:');\n rs = rs.replace(/