You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
suggests to turn on the Remove CSP from target pages.
Unfortunately this checkbox doesn't seem to change the state of the Content-Security-Policy header served to the browser.
Steps to reproduce the behavior
Create a website with a
-- Content-Security-Policy: default-src 'self';
Start up ZAP
Open Options
HUD
Turn on "Remove CSP from target pages"
Go to manual explore
Make sure the HUD checkbox is ticked
Choose Chrome from the browser drop down
Press the Launch Browser Button
Observe that the HUD shows the Unhappy Document icon in the place that the HUD would have been
Open the browser developer tools CTRL+Shift+i
Click on the errors denoted by the x in a red circle
Observe that the Content-Security-Policy is doing it's job by blocking HUD as a Frame when there is no frame-src set.
Expected behavior
Expected ZAP to disable the Content-Security-Policy header in line in order to use the HUD to scan the website when the "Remove CSP from target pages" is enabled.
2022-04-11 09:33:08,942 [ZAP-IO-EventExecutor-3-4] WARN HudAPI - Failed to access script libraries/vue.js via the script extension
2022-04-11 09:33:08,950 [ZAP-IO-EventExecutor-3-3] WARN HudAPI - Failed to access script libraries/vue-i18n.js via the script extension
2022-04-11 09:33:08,950 [ZAP-IO-EventExecutor-3-4] ERROR HudAPI - No such file C:\Users\$USER\OWASP ZAP_D\hud\libraries\vue.js
java.io.FileNotFoundException: libraries/vue.js
at org.zaproxy.zap.extension.hud.HudAPI.getFile(HudAPI.java:429) ~[?:?]
at org.zaproxy.zap.extension.hud.HudFileProxy.handleCallBack(HudFileProxy.java:117) ~[?:?]
at org.zaproxy.zap.extension.api.API.handleApiRequest(API.java:380) ~[zap-D-2022-04-05.jar:D-2022-04-05]
at org.zaproxy.addon.network.internal.server.http.handlers.ZapApiHandler.handleApiRequest(ZapApiHandler.java:93) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.handlers.ZapApiHandler.handleRequest(ZapApiHandler.java:67) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.handlers.HttpRequestHandler.handleMessage0(HttpRequestHandler.java:32) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.handlers.HttpIncludedMessageHandler.handleMessage(HttpIncludedMessageHandler.java:32) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.MainServerHandler.notifyMessageHandlers(MainServerHandler.java:118) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.MainServerHandler.processMessage(MainServerHandler.java:100) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.LocalServerHandler.processMessage(LocalServerHandler.java:63) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.MainServerHandler.process(MainServerHandler.java:83) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.MainServerHandler.channelRead0(MainServerHandler.java:72) ~[?:?]
at org.zaproxy.addon.network.internal.server.http.MainServerHandler.channelRead0(MainServerHandler.java:37) ~[?:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[?:?]
at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[?:?]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
Additional context
none
Would you like to help fix this issue?
Yes
The text was updated successfully, but these errors were encountered:
thc202
changed the title
BUG: HUD "Remove CSP from target pages" doesn't appear to remove the Content-Security-Policy header
"Remove CSP from target pages" doesn't appear to remove the Content-Security-Policy header
Apr 11, 2022
Describe the bug
Some sites set a Content-Security-Policy header to
Content-Security-Policy: default-src 'self';
In order to use the HUD the documentation
https://www.zaproxy.org/docs/desktop/addons/hud/options/#remove-csp-from-target-pages
suggests to turn on the Remove CSP from target pages.
Unfortunately this checkbox doesn't seem to change the state of the Content-Security-Policy header served to the browser.
Steps to reproduce the behavior
--
Content-Security-Policy: default-src 'self';
Expected behavior
Expected ZAP to disable the Content-Security-Policy header in line in order to use the HUD to scan the website when the "Remove CSP from target pages" is enabled.
Software versions
Screenshots
Errors from the zap.log file
Additional context
none
Would you like to help fix this issue?
The text was updated successfully, but these errors were encountered: