Skip to content

Commit 98c7aae

Browse files
committed
Allow img src
1 parent 66b3b7e commit 98c7aae

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

components/dash-html-components/scripts/generate-components.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ const customImportsForComponents = {
256256
object: `import {sanitizeUrl} from '@braintree/sanitize-url';`,
257257
embed: `import {sanitizeUrl} from '@braintree/sanitize-url';`,
258258
button: `import {sanitizeUrl} from '@braintree/sanitize-url';`,
259-
img: `import {sanitizeUrl} from '@braintree/sanitize-url';`,
260259
}
261260

262261
function createXSSProtection(propName) {
@@ -282,8 +281,7 @@ const customCodesForComponents = {
282281
iframe: createXSSProtection('src'),
283282
object: createXSSProtection('data'),
284283
embed: createXSSProtection('src'),
285-
button: createXSSProtection('formAction'),
286-
img: createXSSProtection('src'),
284+
button: createXSSProtection('formAction')
287285
}
288286

289287
function generateComponent(Component, element, attributes) {

tests/integration/security/test_xss.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ def test_xss001_banned_protocols(dash_duo):
2727
html.Iframe(src='javascript:alert("iframe")', id="iframe-src"),
2828
html.ObjectEl(data='javascript:alert("data-object")', id="object-data"),
2929
html.Embed(src='javascript:alert("embed")', id="embed-src"),
30-
# older browser
31-
html.Img(src="javascript:alert('img-sr')", id="img-src"),
3230
]
3331
)
3432

@@ -41,7 +39,6 @@ def test_xss001_banned_protocols(dash_duo):
4139
("#object-data", "data"),
4240
("#embed-src", "src"),
4341
("#button-form-action", "formAction"),
44-
("#img-src", "src"),
4542
):
4643

4744
element = dash_duo.find_element(element_id)

0 commit comments

Comments
 (0)