The Spanner logo
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    The Spanner logo

    The Spanner
    Web security blog

    Made by Gareth Heyes
    Follow me on Twitter: @garethheyes

    Javascript for hackers!

    Hackvertor logo
    Shazzer logo
    My Github account
    Recent posts
    Introducing Feedworm: A Privacy-First RSS Reader That Lives in DevToolsSpeedy RSVP extensionAutoVaderHackvertor history and tag finderShadow Repeater v1.2.3 releaseBurp Hackvertor v2.1.24 releaseHacking roomsXSSing TypeErrors in SafarivalueOf: Another way to get thisMaking the Unexploitable Exploitable with X-Mixed-Replace on FirefoxThe curious case of the evt parameterCSS-Only Tic Tac Toe ChallengeRewriting relative urls with the base tag in SafariBypassing DOMPurify with mXSSNew IE mutation vectorHow I smashed MentalJSMentalJS DOM bypassAnother XSS auditor bypassXSS Auditor bypassBypassing the IE XSS filterUnbreakable filterMentalJS bypassesmXSSJava SerializationBypassing the XSS filter using function reassignmentRPOSandboxed jQueryX-Domain scroll detection on IE using focusEpic fail IEnew operatorDecoding complex non-alphanumeric JavaScriptHacking FirefoxDOM ClobberingBypassing XSS AuditorThe evolution of codeNon-Alpha PHP in 6-7 charsetTweetable PHP-Non AlphaMentalJS for PHPOpera x domain with video tutorialSandboxing and parsing jQuery in 100ms

    The safety net

    By Gareth Heyes (@hackvertor)

    Published 16 years 4 months ago • Last updated March 22, 2025 • ⏱️ 3 min read

    ← Back to articles

    I was thinking about how to prevent a user being exploited lately by whatever method. One thing most attacks have in common is that a user generally needs to initiate the attack by clicking on a email or web site link from a social network. There's a obvious pattern here. Granted some attacks are conducted on the application itself an XSS worm or network worm for example but these aren't as common as the majority of attacks that require some form of initiation.

    My solution? The safety net! When your average joe clicks on a link from twitter, they usually want to watch a funny video or something. Using this to it's advantage the safety net detects when this happens, it is aware of the context of a email for example or that this particular social network is quite popular. When a user clicks a link from that context the browser doesn't need to send any cookie related information from anywhere whilst in the "Safety net".

    It acts as a sandbox for the user protecting them from bad stuff, the user should be aware that they're in it and should not be able to browse like normal unless they open a new window in the traditional means. It could also work for phishing, prompting the user not to enter any confidential information or maybe disabling form input completely except for whitelisted sources. Corporations could configure their safety net to be more restrictive, a policy for disabling javascript for example or maybe only allowing Flash to play video and not execute actionscript.

    If anyone thinks this idea isn't too crazy and decides to implement it here are a couple of suggestions I'll refer to the Safety net as SN:-

    1. Whilst in the SN any executed javascript or other code should always remain in the SN.
    2. New windows or frames should not be allowed in the SN.
    3. The browser should look different in the SN to inform the user that they are in a more restrictive browsing experience.
    4. Closing the SN should be the only way out of it and the user must be clear that is what is happening.
    5. Form input could be restricted in the SN.
    6. Session data or cookies should not be transferred from/to the SN.
    7. ANY form of download should not be permitted in the SN.
    8. Third party plugins should only be allowed in restricted mode for example a PDF file should have a restricted mode which many features are disabled like javascript. Only if this mode is enabled would the PDF be allowed to execute.
    9. Full screen mode should be prevented.
    10. In the SN it is equivalent of opening the browser for the first time.

    Additionally I suggest a meta tag to identify social networks:-

    <pre lang="javascript"> &lt;meta name=&quot;identify&quot; content=&quot;Social Network&quot; /&gt; </pre>

    ← Back to articles