Link to home
Start Free TrialLog in
Avatar of Arikkan
ArikkanFlag for United States of America

asked on

When HTTP Header Content-Security-Policy is set to "Default-src 'self', ASP text box does not get hidden

Hi
When HTTP Header Content-Security-Policy is set to "Default-src 'self', ASP text box does not get hidden

User generated image
This is the piece of code which used to be "hidden" from user, but by setting Content-Security-Policy to Default-src 'self', it shows up on the UI on FireFox and Chrome. It hides correctly on IE.  

            <div style="position: relative; float: left;">
                <asp:TextBox ID="txtTop" runat="server" Width="0px" Height="0px" Style="background: #517ca6;
                    background-color: #517ca6; color: #517ca6;" BorderStyle="None"></asp:TextBox>
            </div>

Any suggestion on how we can keep the control hidden, and be able to set Content-Security-Policy to Default-src 'self'?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Content-Security-Policy is not intended to 'hide' elements on a page but to restrict where files can be loaded from. https://www.owasp.org/index.php/Content_Security_Policy

Show us the 'View Source' for this from your browser.  All elements that start with "<asp:..." are converted to plain HTML values when they are sent to the browser.