Dangling Markup - HTML scriptless injection
最后更新于
这有帮助吗?
最后更新于
这有帮助吗?
and this input field will contain all the content between its double quote and the next double quote in the HTML. This attack mix the "Stealing clear text secrets" with "Stealing forms2".
You can do the same thing injecting a form and an tag. All the data until a closed is found will be sent:
You can change the path of a form and insert new values so an unexpected action will be performed:
Is a tag whose content will be interpreted if the browser doesn't support javascript (you can enable/disable Javascript in Chrome in ).
A way to exfiltrate the content of the web page from the point of injection to the bottom to an attacker controlled site will be injecting this:
From this you can learn that even from the most CSP restricted environments you can still exfiltrate data with some user interaction. In this occasion we are going to use the payload:
Insert a new tag with and id inside the HTML that will overwrite the next one and with a value that will affect the flow of a script. In this example you are selecting with whom a information is going to be shared:
Create variables inside javascript namespace by inserting HTML tags. Then, this variable will affect the flow of the application:
If you find a JSONP interface you could be able to call an arbitrary function with arbitrary data:
Or you can even try to execute some javascript:
Notice that a child document can view and set location property for parent, even if cross-origin. This means that you can make the client access any other page by loading inside an iframe some code like:
This can be mitigated with something like: sandbox=’ allow-scripts allow-top-navigation’
You could use meta http-equiv
to perform several actions like setting a Cookie: or performing a redirect (in 5s in this case):
This can be avoided with a CSP regarding http-equiv ( Content-Security-Policy: default-src 'self';
, or Content-Security-Policy: http-equiv 'self';
)
You can find a very interesting research on exploitable vulnerabilities of the. At the moment of this writing you need to enable the portal tag on Chrome in chrome://flags/#enable-portals
or it won't work.