OWASP GÖTEBORG SEPTEMBER 2012 HYBRID MOBILE APPS & THE EVOLVING WEB BY MIKKO SAARIO. Twitter: @midisfi (http://twitter.

Samankaltaiset tiedostot
Capacity Utilization

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

7.4 Variability management

Arkkitehtuuritietoisku. eli mitä aina olet halunnut tietää arkkitehtuureista, muttet ole uskaltanut kysyä

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

anna minun kertoa let me tell you

Choose Finland-Helsinki Valitse Finland-Helsinki

Windows Phone. Module Descriptions. Opiframe Oy puh Espoo

Information on preparing Presentation

Uusi Ajatus Löytyy Luonnosta 4 (käsikirja) (Finnish Edition)

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Laiteriippumaton UI Ajaxilla ja Javalla

BDD (behavior-driven development) suunnittelumenetelmän käyttö open source projektissa, case: SpecFlow/.NET.

1. Liikkuvat määreet

Results on the new polydrug use questions in the Finnish TDI data

7. Product-line architectures

FinFamily PostgreSQL installation ( ) FinFamily PostgreSQL

Salasanan vaihto uuteen / How to change password

The CCR Model and Production Correspondence

1. SIT. The handler and dog stop with the dog sitting at heel. When the dog is sitting, the handler cues the dog to heel forward.

Rich Web Applications in Server-side Java without Plug-ins or JavaScript

You can check above like this: Start->Control Panel->Programs->find if Microsoft Lync or Microsoft Lync Attendeed is listed

F-SECURE TOTAL. Pysy turvassa verkossa. Suojaa yksityisyytesi. Tietoturva ja VPN kaikille laitteille. f-secure.com/total

TIEKE Verkottaja Service Tools for electronic data interchange utilizers. Heikki Laaksamo

Efficiency change over time

Microsoft Lync 2010 Attendee

16. Allocation Models

HITSAUKSEN TUOTTAVUUSRATKAISUT

Network to Get Work. Tehtäviä opiskelijoille Assignments for students.

TIETEEN PÄIVÄT OULUSSA

Tässä ohjeessa käydään läpi sosiaalisen median verkkopalveluiden lisätoimintojen lisääminen verkkosivuillesi.

National Building Code of Finland, Part D1, Building Water Supply and Sewerage Systems, Regulations and guidelines 2007

Other approaches to restrict multipliers

Miksi Suomi on Suomi (Finnish Edition)

Tietorakenteet ja algoritmit

The necessary product key can be found in the hand out given to you.

Use of spatial data in the new production environment and in a data warehouse

Software Signing System System overview and key domain concepts

Smart access control.

Information on Finnish Courses Autumn Semester 2017 Jenni Laine & Päivi Paukku Centre for Language and Communication Studies

ReFuel 70 % Emission Reduction Using Renewable High Cetane Number Paraffinic Diesel Fuel. Kalle Lehto, Aalto-yliopisto 5.5.

Green Growth Sessio - Millaisilla kansainvälistymismalleilla kasvumarkkinoille?

API:Hack Tournee 2014

AYYE 9/ HOUSING POLICY

Käyttöliittymien uusi sukupolvi Logicalla Rondo-tuotteessa

Sisällysluettelo Table of contents

Constructive Alignment in Specialisation Studies in Industrial Pharmacy in Finland

JWT 2016 luento 11. to klo Aulikki Hyrskykari. PinniB Aulikki Hyrskykari

Sivuston tiedotprintersupportnu mbercare.com

TM ETRS-TM35FIN-ETRS89 WTG

Kysymys 5 Compared to the workload, the number of credits awarded was (1 credits equals 27 working hours): (4)

Lab SBS3.FARM_Hyper-V - Navigating a SharePoint site

TM ETRS-TM35FIN-ETRS89 WTG

IoT-platformien vertailu ja valinta erilaisiin sovelluksiin / Jarkko Paavola

MEETING PEOPLE COMMUNICATIVE QUESTIONS

Gap-filling methods for CH 4 data

WAMS 2010,Ylivieska Monitoring service of energy efficiency in housing Jan Nyman,

make and make and make ThinkMath 2017

( ( OX2 Perkkiö. Rakennuskanta. Varjostus. 9 x N131 x HH145

Metsälamminkankaan tuulivoimapuiston osayleiskaava

Tech Conference Office 365 tietoturvan heikoin #TechConfFI

Tynnyrivaara, OX2 Tuulivoimahanke. ( Layout 9 x N131 x HH145. Rakennukset Asuinrakennus Lomarakennus 9 x N131 x HH145 Varjostus 1 h/a 8 h/a 20 h/a

1.3 Lohkorakenne muodostetaan käyttämällä a) puolipistettä b) aaltosulkeita c) BEGIN ja END lausekkeita d) sisennystä

Encapsulation. Imperative programming abstraction via subprograms Modular programming data abstraction. TTY Ohjelmistotekniikka

Security server v6 installation requirements

Curriculum. Gym card

BLOCKCHAINS AND ODR: SMART CONTRACTS AS AN ALTERNATIVE TO ENFORCEMENT

EARLY LEARNING PLAN / ENGLANTI VARHAISKASVATUSSUUNNITELMA

Innovative and responsible public procurement Urban Agenda kumppanuusryhmä. public-procurement

Security server v6 installation requirements

TM ETRS-TM35FIN-ETRS89 WTG

Group 2 - Dentego PTH Korvake. Peer Testing Report

Automaatiojärjestelmän hankinnassa huomioitavat tietoturva-asiat

The role of 3dr sector in rural -community based- tourism - potentials, challenges

TM ETRS-TM35FIN-ETRS89 WTG

Alueellinen yhteistoiminta

Integration of Finnish web services in WebLicht Presentation in Freudenstadt by Jussi Piitulainen

Tilausvahvistus. Anttolan Urheilijat HENNA-RIIKKA HAIKONEN KUMMANNIEMENTIE 5 B RAHULA. Anttolan Urheilijat

Sivuston tiedotbestsiteanalysis.eu

Lab A1.FARM_Hyper-V.v3

Collaborative & Co-Creative Design in the Semogen -projects

Hankkeiden vaikuttavuus: Työkaluja hankesuunnittelun tueksi

TM ETRS-TM35FIN-ETRS89 WTG

( ,5 1 1,5 2 km

SpeechMike III sarjan sanelumikrofonien (mallit LFH3200 ja LFH3220) yhteensopivuus SpeechMagic Executive saneluohjelman kanssa

TM ETRS-TM35FIN-ETRS89 WTG

ENE-C2001 Käytännön energiatekniikkaa. Aloitustapaaminen Osa II: Projekti- ja tiimityö

EVALUATION FOR THE ERASMUS+-PROJECT, STUDENTSE

Kylänetti projektin sivustojen käyttöohjeita Dokumentin versio 2.10 Historia : 1.0, 1.2, 1.6 Tero Liljamo / Deserthouse, päivitetty 25.8.

ECVETin soveltuvuus suomalaisiin tutkinnon perusteisiin. Case:Yrittäjyyskurssi matkailualan opiskelijoille englantilaisen opettajan toteuttamana

LANSEERAUS LÄHESTYY AIKATAULU OMINAISUUDET. Sähköinen jäsenkortti. Yksinkertainen tapa lähettää viestejä jäsenille

TW-LTE 4G/3G. USB-modeemi (USB 2.0)

Uusi Ajatus Löytyy Luonnosta 3 (Finnish Edition)

KMTK lentoestetyöpaja - Osa 2

Strategiset kyvykkyydet kilpailukyvyn mahdollistajana Autokaupassa Paula Kilpinen, KTT, Tutkija, Aalto Biz Head of Solutions and Impact, Aalto EE

OFFICE 365 OPISKELIJOILLE

Guidebook for Multicultural TUT Users

HTML 5 Johdanto. Mikä on HTML 5

FinFamily Installation and importing data ( ) FinFamily Asennus / Installation

WindPRO version joulu 2012 Printed/Page :42 / 1. SHADOW - Main Result

Transkriptio:

OWASP GÖTEBORG SEPTEMBER 2012 HYBRID MOBILE APPS & THE EVOLVING WEB BY MIKKO SAARIO Twitter: @midisfi (http://twitter.com/midisfi)

THIS IS NOT YOUR UNCLE OLOF'S "OWASP TOP 10 MOBILE SECURITY" TALK

AGENDA 1. Hybrid environments & the Open Web Platform Hybrid environments mix HTML+JS with Native code OWP + a peek into stuff like getusermedia 30 min or so 2. Case review from the mixed world Security evaluation of a new multi-technology application 10 min or so 3. Security and Agile development - do they mix? A bit of theory And a bit of practice - 1st hand 20 min or so

Oh well Almost got a 'Bingo'

ME Nokia Security manager for Sales & Marketing services Founder of OWASP Helsinki Motto: "the more you learn, the less you seem to know" More of a Defender & Breaker than a Builder

POLL

DISCLAIMER Examples Are for Windows Phone 7.5 with an odd Qt/QML one thrown in Android and iphone guys - just be cool

TRADITIONAL AIR GAP A PRETTY EFFECTIVE SECURITY CONTROL

WEB HAD NO ACCESS TO DEVICE API

SECURITY USED TO BE SIGNING APPS WITH CAPABILITIES Permission, privilege, you name it... So, installation handled the "rights" BUFFER OVERFLOWS SMS OF DEATH MALWARE AND SO FORTH

AND STILL IS... THEY DIDN'T DISAPPEAR

BRIDGING THE AIR GAP #1 NATIVE += WEB HYBRID

LET'S ADD A WEBVIEW import QtWebKit 1.0 WebView { url: "https://www.owasp.org" preferredwidth: 490 preferredheight: 400 scale: 0.5 smooth: false } Code: Qt/QML

MAGIC HAPPENS

A HYBRID ENVIRONMENT Native mobile apps utilize Web technologies inside the app HTML, CSS and JavaScript embedded in / utilized by native code (C#, VB, objective-c, C++, "java") Typically utilizing /(ui)?web(view Browser)/g class For the rest of us: a "WebBrowser", "uiwebview", or just plain "WebView" Windows Phone 7: WebBrowser control Rendering engine without the "chrome" (Browser UI)

COMMON Qt/QML multiplatform Widgets Android Mac OS X, ios Windows OS / Phone Apache Cordova / PhoneGap

NATIVE AND JS CAN TALK In native, expose an interface to JS <phone:webbrowser ScriptNotify="alert_ScriptNotify" IsScriptEnabled="True" /> Javascript calls the parent native app function AlertSilverlight(data) { window.external.notify(data); } AlertSilverlight(1); Listener picks it up and executes private void alert_scriptnotify(object sender, NotifyEvent Args e) { MessageBox.Show(e.Value); } Code: WinPhone 7 C#/Silverlight/XAML/JavaScript

SECURITY FUNDAMENTALS

OWASP TOP TEN YES, IT'S ALL VERY VALID BOTH OF THEM

UI CONTROLS A lot of the usual UI controls are missing E.g. WP7 will silently fail self-signed, untrusted SSL cert No SSL "lock" visible Warnings, popups etc.

SAME ORIGIN POLICY Notes for Windows Phone 7 Content loaded from isolated storage is not restricted by SOP (file:///) Content created via NavigateToString is not restricted by SOP var html = "<html><script>...code... </script></ html>" webbrowser1.navigatetostring(html); JavaScript called via InvokeScript can be from any domain Some difference on desktop vs mobile E.G. QT HAS SOP LIMITS ON FILE:///

EVAL IS STILL EVIL ARE YOU EVAL'ING SOME INPUT? eval(), settimeout(), setinterval(), new Function()

BUFFER OVERFLOWS THE ABOVE KILLED N9 TWITTER CLIENT (QT & C++) we can't know how much space we need to allocate......for this pathological string we are generating two glyphs for each character.

INJECTIONS SQL injection XML Query / XPath injection Using XQuery or XPath dynamically with user-supplied input could leave you vulnerable in Qt Use bound parameters

DENIAL OF SERVICE Isolated storage on WP7 has no size restrictions So one app may fill up the whole storage space

CONFIGURATIONS Define your environment specs Your mileage will vary greatly Each framework has their own details

SCRIPTING /* Qt default: true */ QWebSettings::JavascriptEnabled QWebSettings::JavascriptCanOpenWindows QWebSettings::JavascriptCanAccessClipboard <!-- Windows Phone 7 default: disabled --> <Grid x:name="layoutroot"> <phone:webbrowser Name="mybrowser" IsScriptEnabled="True" Source="index.html" ScriptNotify="pokeMyScript" /> </Grid>

PLUGINS Java, Flash and other plugins /* Qt; No plugins in WP7 */ QWebSettings::JavaEnabled QWebSettings::PluginsEnabled

ETC. Configure cross-domain actions QWebSettings::XSSAuditingEnabled QWebSettings::LocalContentCanAccessRemoteUrls QWebSettings::LocalContentCanAccessFileUrls /* can qrc:// access file:// */ Anything else that is configurable QWebSettings::PrivateBrowsingEnabled QWebSettings::DeveloperExtrasEnabled IsGeolocationEnabled = "true"

DEMO TIME A WP7 DEMO APP

BRIDGING THE AIR GAP #2 OPEN WEB PLATFORM / HTML5

OPEN WEB PLATFORM HTML5 (of course) Web APIs DOM CSS SVG MathML WebRTC Device APIs EcmaScript / JavaScript HTTP, URI Media Accessibility Checklist etc.

WebRTC WEB REAL TIME COMMUNICATIONS MediaStream (getusermedia) Access to e.g. device camera and microphone PeerConnection (peer-to-peer connections) Enables e.g. VoIP from browser to browser (using ICE + STUN & TURN servers)...lets look at getusermedia in a moment

Web APIs Clipboard API File API Fullscreen Gamepad Indexed DB Pointer Lock Web Workers XHR2 (CORS) etc. etc. etc. Boot to Gecko (https://wiki.mozilla.org/webapi)

Device APIs Battery Status Calendar API Contacts API Device Orientation API Geolocation + level 2 Media Capture (gone) Vibration API etc. etc.

Remember the Good Old Flash Camera Snooping Days? Are they coming back?

getusermedia Hello, World! img source: http://safeandsavvy.f-secure.com

BLEEDING EDGE CHROME 21 FIREFOX 16+ OPERA 12 OPERA MOBILE 12 { ANDROID > SYMBIAN }

NU SKA NI FÅ LÄRÄ ER LITE FINSKA

CHROME 21 JA / NEJ

OPERA 12

FIREFOX 15 OOPS NO GO :) Looks more like FF 16 & 17 (http://alexandre.alapetite.fr/doc-alex/html5-webcam/)

DEMO2 TIME GETUSERMEDIA ON A STANDARD BROWSER

ANDROID 4.0 ICS CHROME & NATIVE BROWSER: NO GO

IFRAME CAMERA W3C proposal & current implementation: -------------------------------------- In order to prevent unexpected behaviour and to stay on the safe side of user's privacy, it may be useful to explicitly mention in the specification that calls from s be silently denied.... "No conclusion" W3C site (http://www.w3.org/wiki/media_capture#iframe_behavior)

FILE API SANDBOXED LOCAL FILESYSTEM filesystem:http://localhost/temporary/

DEMO Verkkosivu ei ole käytettävissä Google Chrome ei voinut muodostaa yhteyttä osoitteeseen localhost. Sivusto voi olla pois käytöstä tai verkon asetuksissa voi olla virhe. Seuraavassa on joitakin ehdotuksia: Päivitä tämä sivu myöhemmin. Tarkista internetyhteytesi. Käynnistä uudelleen reititin, modeemi tai muut käytössä olevat verkkolaitteet. Kokeile lisätä Google Chrome sallittujen ohjelmien luetteloon palomuurisi tai virustorjuntaohjelmasi asetuksissa. Jos ohjelma on jo sallittu, kokeile poistaa se sallittujen ohjelmien luettelosta ja lisätä se sitten uudelleen. Jos käytät välityspalvelinta, tarkista välityspalvelinasetukset tai ota yhteyttä verkon ylläpitäjään ja varmista, että välityspalvelin toimii. Jos käytössä ei pitäisi olla Verkkosivu ei ole käytettävissä Google Chrome ei voinut muodostaa yhteyttä osoitteeseen localhost. Sivusto voi olla pois käytöstä tai verkon asetuksissa voi olla virhe. Seuraavassa on joitakin ehdotuksia: Päivitä tämä sivu myöhemmin. Tarkista internetyhteytesi. Käynnistä uudelleen reititin, modeemi tai muut käytössä olevat verkkolaitteet. Kokeile lisätä Google Chrome sallittujen ohjelmien luetteloon palomuurisi tai virustorjuntaohjelmasi asetuksissa. Jos ohjelma on jo sallittu, kokeile poistaa se sallittujen ohjelmien luettelosta ja lisätä se sitten uudelleen. Jos käytät välityspalvelinta, tarkista välityspalvelinasetukset tai ota yhteyttä verkon ylläpitäjään ja varmista, että välityspalvelin toimii. Jos käytössä ei pitäisi olla

CHROME APPS Apps run outside "chrome browser", no browser UI But made with html, js & css "Offline", but appear like native apps Quite strict security model: Mandatory strict CSP Prevents inline scripts, eval & "new Function()" Those can be used in a sandboxed (iframe) page <browser> tag to safely display web content Accept permissions at installation Each window can have separate privileges (reduce attack surface) Process and storage isolation Access ext content, but e.g. xhr requires whitelisting the site New APIs to access OS: bluetooth, usb etc.

END OF PART 1

CASE STUDY

AGILE EXPERIENCES WITH AGILE TEAMS

THEORY Proudly reused from: www.digdes.com

KEY CONCEPTS Epics, user stories and features Abuse stories Sprint vs Product backlog Sprint review & Definition of Done Tools, aides, etc.

"OPERATIONAL TASKS" Security related work not related to user stories Things like patches, scans, significant vulnerabilities Extra reviews of risky code Often, but not always, goes into the backlog

TEAM Main product dev teams in one place Three scrum teams Two week sprints Testing team Ops team Architect(s) + support functions Client SDK teams "right-shored" Full-time security manager -> security architect One of the devs was nominated as "security responsible"

KEY CHALLENGES Lots of historical baggage (known issues a.k.a. "technical/security debt") High pressure to push out new features Also strong focus on availability Security on back burner Keep security on the table continuously, not ad-hoc

KEY ACTIVITIES Epics, stories, features were complemented with security reviews/discussions Architecture was out of band, more forward-looking Security manager was changed to a security architect (possible due to attrition) Security sprints were conducted to "clear" a lot of old debt Sprint backlog items were pre-munched for security aspects (had to have basic definition in place) Code scanning, vuln scanning etc. was end of sprint or out of band Security audits, pentests, etc. were also out of band Testing was both focused unit testing & broader integration testing (added sec cases)

QUESTIONS?