Outline Cross-site scripting, cont’d More cross-site risks CSci 5271 Introduction to Computer Security Announcements intermission Web security and crypto failure combined Confidentiality and privacy lecture Even more web risks Stephen McCamant University of Minnesota, Computer Science & Engineering More crypto protocols More causes of crypto failure Filter failure: one-pass delete Filter failure: UTF-7 You may have heard of UTF-8 Encode Unicode as 8-bit bytes Simple idea: remove all occurrences of UTF-7 is similar but uses only ASCII ❁s❝r✐♣t❃ Encoding can be specified in a ❁♠❡t❛❃ What happens to ❁s❝r❁s❝r✐♣t❃✐♣t❃ ? tag, or some browsers will guess ✰❆❉✇✲s❝r✐♣t✰❆❉✹✲ Filter failure: event handlers Use good libraries Coding your own defenses will never ❁■▼● ♦♥♠♦✉s❡♦✈❡r❂✧❛❧❡rt✭✬①ss✬✮✧❃ work Put this on something the user will be Take advantage of known good tempted to click on implementations There are more than 100 handlers like Best case: already built into your this recognized by various browsers framework Disappointingly rare
Content Security Policy Outline Cross-site scripting, cont’d New HTTP header, W3C candidate More cross-site risks recommendation Lets site opt-in to stricter treatment of Announcements intermission embedded content, such as: Confidentiality and privacy No inline JS, only loaded from separate URLs Even more web risks Disable JS ❡✈❛❧ et al. More crypto protocols Has an interesting violation-reporting More causes of crypto failure mode HTTP header injection Content sniffing Browsers determine file type from headers, extension, and content-based Untrusted data included in response guessing headers Latter two for ✘ ✶ % server errors Can include CRLF and new headers, or Many sites host “untrusted” images premature end to headers and media AKA “response splitting” Inconsistencies in guessing lead to a kind of XSS E.g., “chimera” PNG-HTML document Cross-site request forgery CSRF prevention Certain web form on ❜❛♥❦✳❝♦♠ used to wire money Give site’s forms random-nonce tokens Link or script on ❡✈✐❧✳❝♦♠ loads it E.g., in POST hidden fields with certain parameters Not in a cookie, that’s the whole point Reject requests without proper token Linking is exception to same-origin If I’m logged in, money sent Or, ask user to re-authenticate automatically XSS can be used to steal CSRF tokens Confused deputy, cookies are ambient authority
Open redirects Outline Cross-site scripting, cont’d Common for one page to redirect More cross-site risks clients to another Target should be validated Announcements intermission With authentication check if appropriate Confidentiality and privacy Open redirect : target supplied in Even more web risks parameter with no checks Doesn’t directly hurt the hosting site More crypto protocols But reputation risk, say if used in phishing More causes of crypto failure We teach users to trust by site Newly released assignments HA 2 questions 1. Network sniffing 2. Offline dictionary attack Exercise set 4 due next Wednesday 3. Forging predictable cookies 4/10 4. SQL injection HA2 due Monday 4/15 (also tax day) 5. Cross-site scripting 6. Crypto. attack against a poor MAC Outline Site perspective Cross-site scripting, cont’d Protect confidentiality of authenticators More cross-site risks Passwords, session cookies, CSRF tokens Announcements intermission Duty to protect some customer info Confidentiality and privacy Personally identifying info (“identity theft”) Credit-card info (Payment Card Industry Even more web risks Data Security Standards) Health care (HIPAA), education (FERPA) More crypto protocols Whatever customers reasonably expect More causes of crypto failure
You need to use SSL Server-side encryption Finally coming around to view that Also consider encrypting data “at rest” more sites need to support HTTPS (Or, avoid storing it at all) Special thanks to WiFi, NSA Provides defense in depth If you take credit cards (of course) Reduce damage after another attack If you ask users to log in May be hard to truly separate keys Must be protecting something, right? OWASP example: public key for website Also important for users of Tor et al. ✦ backend credit card info Adjusting client behavior User vs. site perspective HTTPS and ♣❛ss✇♦r❞ fields are basic hints User privacy goals can be opposed to Consider disabling autocomplete site goals Usability tradeoff, save users from Such as in tracking for advertisements themselves Browser makers can find themselves in Finally standardized in HTML5 the middle Consider disabling caching Of course, differ in institutional pressures Performance tradeoff Better not to have this on user’s disk Or proxy? You need SSL Third party content / web bugs Cookies arms race Much tracking involves sites other than Privacy-sensitive users like to block the one in the URL bar and/or delete cookies For fun, check where your cookies are Sites have various reasons to retain coming from identification Various levels of cooperation Various workarounds: Web bugs are typically 1x1 images used Similar features in Flash and HTML5 only for tracking Various channels related to the cache Evercookie : store in ♥ places, regenerate if subset are deleted
Browser fingerprinting History stealing History of what sites you’ve visited is Combine various server or JS-visible not supposed to be JS-visible attributes passively But, many side-channel attacks have User agent string (10 bits) been possible Window/screen size (4.83 bits) Query link color Available fonts (13.9 bits) CSS style with external image for visited Plugin verions (15.4 bits) links (Data from ♣❛♥♦♣t✐❝❧✐❝❦✳❡❢❢✳♦r❣ , far from Slow-rendering timing channel Harvesting bitmaps exhaustive) User perception (e.g. fake CAPTCHA) Browser and extension choices Outline Cross-site scripting, cont’d More aggressive privacy behavior lives More cross-site risks in extensions Disabling most JavaScript (NoScript) Announcements intermission HTTPS Everywhere (whitelist) Tor Browser Bundle Confidentiality and privacy Default behavior is much more Even more web risks controversial More crypto protocols Concern not to kill advertising support as an economic model More causes of crypto failure Misconfiguration problems Openness tradeoffs Error reporting Default accounts Few benign users want to see a stack backtrace Unneeded features Directory listings Framework behaviors Hallmark of the old days Don’t automatically create variables from Readable source code of scripts query fields Doesn’t have your DB password in it, does it?
Using vulnerable components Clickjacking Fool users about what they’re clicking Large web apps can use a lot of on third-party code Circumvent security confirmations Convenient for attackers too Fabricate ad interest OWASP: two popular vulnerable Example techniques: components downloaded 22m times Frame embedding Hiding doesn’t work if it’s popular Transparency Stay up to date on security Spoof cursor Temporal “bait and switch” announcements Crawling and scraping Outline Cross-site scripting, cont’d A lot of web content is free-of-charge, but proprietary More cross-site risks Yours in a certain context, if you view Announcements intermission ads, etc. Sites don’t want it downloaded Confidentiality and privacy automatically ( web crawling ) Even more web risks Or parsed and user for another More crypto protocols purpose ( screen scraping ) More causes of crypto failure High-rate or honest access detectable Abstract protocols Protocol notation Outline of what information is communicated in messages ❆ ✦ ❇ ✿ ◆ ❇ ❀ ❢ ❚ ✵ ❀ ❇❀ ◆ ❇ ❣ ❑ ❇ Omit most details of encoding, naming, ❆ ✦ ❇ : message sent from Alice sizes, choice of ciphers, etc. intended for Bob Describes honest operation ❇ (after :): Bob’s name But must be secure against adversarial participants ❢ ✁ ✁ ✁ ❣ ❑ : encryption with key ❑ Seemingly simple, but many subtle problems
Recommend
More recommend