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
    Pure-CSS 3D world collision detection How to write a Hackvertor tagIntroducing 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 PHP

    I know what your friends did last summer

    By Gareth Heyes (@hackvertor)

    Published 17 years 7 months ago • Last updated March 22, 2025 • ⏱️ 2 min read

    ← Back to articles

    I did report this to Twitter a few weeks ago, but now that Chris Heilmann has let the cat out of the bag I'll post my repro now. Basically Twitter JSON security is leaking data, the JSON feeds that are publically available shouldn't be IMO or at least protected using known methods.

    So if you use Twitter a web site can know who you are and who your friends are. Spammers could you this data to automate targeted spamming attacks or maybe automated social engineering, you're more like to open a email attachment off your friends right?

    The attack works by including the JSON data using a script tag on any web site, using setters you can get the data of the JSON feed in every browser except IE (in my testing).

    <pre lang="javascript"> &lt;script&gt; Object.prototype.__defineSetter__('user',function(obj){for(var i in obj) {alert(i + '=' + obj[i]);} }); &lt;/script&gt; &lt;script defer=&quot;defer&quot; src=https://twitter.com/statuses/friends_timeline/&gt; &lt;/script&gt; </pre>

    Originally I thought it was a bug in Firefox, that's why I've used Object.prototype and not simply Object but I found a post by Joe Walker which uses a far better technique to grab all the data.

    Here is the proof of concept to prove I do know what your friends did last summer:- twitter json hack

    ← Back to articles