The document discusses the history and development of the Document Object Model (DOM) from its early implementations in 1995 to modern standards. It outlines key milestones like DOM Level 1 in 1998, the rise of JavaScript frameworks like Prototype, jQuery and MooTools in 2005-2006, and ongoing work by the W3C and WHATWG. The talk will explore security issues that can arise from the DOM's ability to convert strings to executable code and demonstrate an attack technique called DOM clobbering.
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...Mario Heiderich
ECMAScript 6, in short ES6, has been boiling in a copper pot for many years by now and step-by-step, browser vendors come forward to taste the first sips of this mystery soup. So, ES6 is no longer a theoretic language but already crawled across the doorstep and now lurks under your bed, ready for the nasty, waiting for the right moment to bite.
Now, what is this whole ES6 thing? How did it develop and who made it? And why is it now implemented in your favorite browser? And what does it mean for web-security and beyond?
This talk will answer these questions and showcase the new language from an attacker's perspective. You will see the new code constructs possible to be executed with ES6, new attack vectors and learn what you can do to tame that beast. Kafkaesque terminology such as expression interpolation, proper tail calls, computed properties, spread parameters, modules and tagged template strings will no longer be surprising you after attending this talk.
The document discusses security issues with AngularJS and summarizes four general attack vectors:
A1: Attacking the AngularJS sandbox by bypassing restrictions on dangerous objects and methods. Early versions had trivial bypasses but later versions required more creative techniques.
A2: Attacking the AngularJS sanitizer, which aims to sanitize HTML strings and remove XSS attacks. There were issues with both an older sanitizer version and the current version.
A3: Attacking the Content Security Policy (CSP) mode in AngularJS.
A4: Attacking vulnerabilities directly in the AngularJS codebase through techniques like sandbox bypasses.
OWASP SF - Reviewing Modern JavaScript ApplicationsLewis Ardern
The document provides an overview of reviewing modern JavaScript applications for security. It discusses how JavaScript is used widely, common frameworks like React and Angular, and tools for analyzing JavaScript like ESLint. It also covers real-world examples of vulnerabilities like cross-site scripting and remote code execution. The talk emphasizes embracing developer tools and best practices like code reviews and linting to identify security issues in JavaScript applications.
Slides from the NestJS MasterClass.
We learned how to build JavaScript server-side applications with NestJS - A progressive NodeJS framework built with TypeScript.
You can find the code on GitHub:
https://github.com/nirkaufman/task-manager
My slides for understanding Pentesting for GraphQL Applications. I presented this content at c0c0n and bSides Delhi 2018. Also contains details of my Burp Extension for GraphQL parsing and scanning located here https://github.com/br3akp0int/GQLParser
The document provides an introduction to React, a JavaScript library for building user interfaces. It discusses key React concepts like components, properties, state, one-way data flow, and JSX syntax. It also covers setting up a development environment with Create React App and shows how to create a basic React component with state. The target audience appears to be people new to React who want to learn the fundamentals.
The document provides an overview of installing PHP on Windows systems. It discusses choosing between the Windows InstallShield method (for beginners) or manual binary installation. The InstallShield process is demonstrated step-by-step using IIS as an example, covering downloading, choosing options, file extensions, and testing. The manual method requires copying files, setting permissions, and configuring the web server by adding application mappings in IIS. Examples demonstrate including header and footer files to create templates.
Practical and conceptual overview of Javascript prototype paradigm, how to use prototypes, how do they work, and how do they differ from classes, and why there are no real classes in Javascript.
This document discusses JavaScript events and event listeners. It begins with an introduction that defines events as notifications that specific actions occurred, like user or browser actions. Event handlers are scripts that are executed in response to events. Events can be used to trigger JavaScript code that responds to user interactions. The document then provides examples of common event types like onclick, onsubmit, onmouseover, onmouseout, focus, and blur. It also discusses how to add and remove event listeners using addEventListener() and removeEventListener() methods. The document concludes with an example demonstrating how events can be used to change an HTML element in response to user clicks.
Most learning materials for web app pentesting focus on “old school” apps. Maybe they have a little jQuery sprinkled in, but most of the heavy-lifting happens server-side. With the dawn of frontend frameworks like AngularJS, Vue, and React and Single-Page Applications, the way web apps are developed is changing, and pentesters need to keep up. This talk runs through common security issues with and approaches to testing these new apps.
Talk about how to design code that helps one to avoid some of the issues identified on OWASP top 10. Domain Driven Security is one of the main tools to achieve this.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
Vault is a tool for securely accessing secrets like API keys and passwords. It allows for [1] generating short-term credentials to access services like AWS, [2] easy revocation of credentials, and [3] auditing of secret access. Vault uses a seal/unseal process where secrets are encrypted at rest requiring threshold of keys to unseal. The document discusses best practices like using tokens for authentication, safeguarding storage backends, and setting up high availability.
This document discusses various methods for escalating privileges on Windows and Linux systems. It begins by covering remote exploitation of vulnerable services running with high privileges. It then covers other methods such as exploiting weak passwords, insecure file/registry permissions, misconfigured services, and kernel exploits. Specific examples discussed include exploiting sudo permissions, cron jobs, service binary path manipulation, and the DirtyCOW Linux privilege escalation.
Spring Security is a powerful and highly customizable authentication and authorization framework for Spring-based applications. It provides authentication via mechanisms like username/password, LDAP, and SSO. Authorization can be implemented through voting-based access control or expression-based access control at the web (URL) level and method level. It includes filters, providers, and services to handle authentication, authorization, logout, and remember-me functionality. Configuration can be done through XML or Java configuration with support for common annotations.
NodeJS is an open source, cross platform run time environment for server side and networking application. NodeJS is popular in development because front & back end side both uses JavaScript Code.
Path traversal attacks aim to access files outside a webroot folder by exploiting how web servers handle special directory traversal characters like "..". An attacker can use these characters in a request to climb the directory structure and potentially read sensitive files. They may also try encoding the special characters to bypass security filters. To prevent this, servers should carefully filter user input, ensure only authorized directories are accessible, and keep sensitive files outside public folders.
React is a JavaScript library for building user interfaces. It uses a component-based approach where UI is broken into independent, reusable pieces called components. Components are like functions that return markup describing part of a view. React uses a virtual DOM to efficiently update the real DOM by only making necessary changes. This improves performance by avoiding expensive DOM operations and minimizing DOM access. Components receive data and callbacks through properties and local state is updated using setState(), triggering a re-render of changed parts of the UI.
The document discusses various methods for efficiently serializing and deserializing data in C# using MessagePack, including:
- Methods for reading primitive data types like integers and floats from bytes
- Representing float values as individual bytes for efficient serialization
- Using lookup tables and decoder interfaces to quickly determine MessagePack types and decode values
- Discussing faster alternatives like using direct memory copying instead of serialization delegates
- Mentioning how to extend MessagePack specifications while maintaining compatibility for faster serialization
This talk introduces and discusses a novel, mostly unpublished technique to successfully attack websites that are applied with state-of-the-art XSS protection. This attack labeled Mutation-XSS (mXSS) is capable of bypassing high-end filter systems by utilizing the browser and its unknown capabilities - every single f***** one of them. We analyzed the type and number of high-profile websites and applications that are affected by this kind of attack. Several live demos during the presentation will share these impressions and help understanding, what mXSS is, why mXSS is possible and why it is of importance for defenders as well as professional attackers to understand and examine mXSS even further. The talk wraps up several years of research on this field, shows the abhorrent findings, discusses the consequences and delivers a step-by-step guide on how to protect against this kind of mayhem - with a strong focus on feasibility and scalability.
GoLang is an open source programming language created by Google in 2009. It has a large community and was designed for scalability and concurrency. Some key features include being statically typed, compiled, and having built-in support for concurrency through goroutines and channels. Google uses GoLang extensively to build systems that scale to thousands of machines.
HTTP headers carry important information in web requests and responses between browsers and servers. They define the request and response details like the request method, resources used, sender and receiver details, and content type. Common HTTP headers provide information on the request method, resources consumed, sender and destination, and content type. Tools like the Live HTTP Headers browser add-on or inspect element can be used to view HTTP headers and their carried information.
Typescript is a typed superset of JavaScript that adds additional features like classes, interfaces, and modules to provide type safety and help manage large applications. It allows for type annotations, classes, interfaces, generics and other features to support object-oriented and modular programming. Typescript code compiles to plain JavaScript and is an open source project maintained by Microsoft.
Deep Dive async/await in Unity with UniTask(EN)Yoshifumi Kawai
The document discusses asynchronous programming in C# using async/await and Rx. It explains that async/await is not truly asynchronous or multithreaded - it is for asynchronous code that runs on a single thread. UniTask is introduced as an alternative to Task that is optimized for Unity's single-threaded environment by avoiding overhead like ExecutionContext and SynchronizationContext. Async/await with UniTask provides better performance than coroutines or Rx observables for Unity.
The document discusses the Document Object Model (DOM) and how it allows programs and scripts to dynamically access and update the content, structure, and style of an HTML or XML document. It defines the DOM as a standard set by the W3C. The document then discusses the DOM for HTML documents (HTML DOM) and how it defines HTML elements as objects and provides properties and methods to access and modify those elements. It also discusses DOM events and how they allow JavaScript to add event handlers to HTML elements for user interactions.
This document provides an overview of HTML5 and XHTML2. It discusses the history of each standard, including periods where work took place outside the W3C. Key differences are that HTML5 focuses on evolving the existing web incrementally to support applications, while XHTML2 aimed to switch to a more declarative XML-based approach. HTML5 is natively supported in browsers, while XHTML2 likely remains most useful for server-side authoring.
The document provides an overview of installing PHP on Windows systems. It discusses choosing between the Windows InstallShield method (for beginners) or manual binary installation. The InstallShield process is demonstrated step-by-step using IIS as an example, covering downloading, choosing options, file extensions, and testing. The manual method requires copying files, setting permissions, and configuring the web server by adding application mappings in IIS. Examples demonstrate including header and footer files to create templates.
Practical and conceptual overview of Javascript prototype paradigm, how to use prototypes, how do they work, and how do they differ from classes, and why there are no real classes in Javascript.
This document discusses JavaScript events and event listeners. It begins with an introduction that defines events as notifications that specific actions occurred, like user or browser actions. Event handlers are scripts that are executed in response to events. Events can be used to trigger JavaScript code that responds to user interactions. The document then provides examples of common event types like onclick, onsubmit, onmouseover, onmouseout, focus, and blur. It also discusses how to add and remove event listeners using addEventListener() and removeEventListener() methods. The document concludes with an example demonstrating how events can be used to change an HTML element in response to user clicks.
Most learning materials for web app pentesting focus on “old school” apps. Maybe they have a little jQuery sprinkled in, but most of the heavy-lifting happens server-side. With the dawn of frontend frameworks like AngularJS, Vue, and React and Single-Page Applications, the way web apps are developed is changing, and pentesters need to keep up. This talk runs through common security issues with and approaches to testing these new apps.
Talk about how to design code that helps one to avoid some of the issues identified on OWASP top 10. Domain Driven Security is one of the main tools to achieve this.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
Vault is a tool for securely accessing secrets like API keys and passwords. It allows for [1] generating short-term credentials to access services like AWS, [2] easy revocation of credentials, and [3] auditing of secret access. Vault uses a seal/unseal process where secrets are encrypted at rest requiring threshold of keys to unseal. The document discusses best practices like using tokens for authentication, safeguarding storage backends, and setting up high availability.
This document discusses various methods for escalating privileges on Windows and Linux systems. It begins by covering remote exploitation of vulnerable services running with high privileges. It then covers other methods such as exploiting weak passwords, insecure file/registry permissions, misconfigured services, and kernel exploits. Specific examples discussed include exploiting sudo permissions, cron jobs, service binary path manipulation, and the DirtyCOW Linux privilege escalation.
Spring Security is a powerful and highly customizable authentication and authorization framework for Spring-based applications. It provides authentication via mechanisms like username/password, LDAP, and SSO. Authorization can be implemented through voting-based access control or expression-based access control at the web (URL) level and method level. It includes filters, providers, and services to handle authentication, authorization, logout, and remember-me functionality. Configuration can be done through XML or Java configuration with support for common annotations.
NodeJS is an open source, cross platform run time environment for server side and networking application. NodeJS is popular in development because front & back end side both uses JavaScript Code.
Path traversal attacks aim to access files outside a webroot folder by exploiting how web servers handle special directory traversal characters like "..". An attacker can use these characters in a request to climb the directory structure and potentially read sensitive files. They may also try encoding the special characters to bypass security filters. To prevent this, servers should carefully filter user input, ensure only authorized directories are accessible, and keep sensitive files outside public folders.
React is a JavaScript library for building user interfaces. It uses a component-based approach where UI is broken into independent, reusable pieces called components. Components are like functions that return markup describing part of a view. React uses a virtual DOM to efficiently update the real DOM by only making necessary changes. This improves performance by avoiding expensive DOM operations and minimizing DOM access. Components receive data and callbacks through properties and local state is updated using setState(), triggering a re-render of changed parts of the UI.
The document discusses various methods for efficiently serializing and deserializing data in C# using MessagePack, including:
- Methods for reading primitive data types like integers and floats from bytes
- Representing float values as individual bytes for efficient serialization
- Using lookup tables and decoder interfaces to quickly determine MessagePack types and decode values
- Discussing faster alternatives like using direct memory copying instead of serialization delegates
- Mentioning how to extend MessagePack specifications while maintaining compatibility for faster serialization
This talk introduces and discusses a novel, mostly unpublished technique to successfully attack websites that are applied with state-of-the-art XSS protection. This attack labeled Mutation-XSS (mXSS) is capable of bypassing high-end filter systems by utilizing the browser and its unknown capabilities - every single f***** one of them. We analyzed the type and number of high-profile websites and applications that are affected by this kind of attack. Several live demos during the presentation will share these impressions and help understanding, what mXSS is, why mXSS is possible and why it is of importance for defenders as well as professional attackers to understand and examine mXSS even further. The talk wraps up several years of research on this field, shows the abhorrent findings, discusses the consequences and delivers a step-by-step guide on how to protect against this kind of mayhem - with a strong focus on feasibility and scalability.
GoLang is an open source programming language created by Google in 2009. It has a large community and was designed for scalability and concurrency. Some key features include being statically typed, compiled, and having built-in support for concurrency through goroutines and channels. Google uses GoLang extensively to build systems that scale to thousands of machines.
HTTP headers carry important information in web requests and responses between browsers and servers. They define the request and response details like the request method, resources used, sender and receiver details, and content type. Common HTTP headers provide information on the request method, resources consumed, sender and destination, and content type. Tools like the Live HTTP Headers browser add-on or inspect element can be used to view HTTP headers and their carried information.
Typescript is a typed superset of JavaScript that adds additional features like classes, interfaces, and modules to provide type safety and help manage large applications. It allows for type annotations, classes, interfaces, generics and other features to support object-oriented and modular programming. Typescript code compiles to plain JavaScript and is an open source project maintained by Microsoft.
Deep Dive async/await in Unity with UniTask(EN)Yoshifumi Kawai
The document discusses asynchronous programming in C# using async/await and Rx. It explains that async/await is not truly asynchronous or multithreaded - it is for asynchronous code that runs on a single thread. UniTask is introduced as an alternative to Task that is optimized for Unity's single-threaded environment by avoiding overhead like ExecutionContext and SynchronizationContext. Async/await with UniTask provides better performance than coroutines or Rx observables for Unity.
The document discusses the Document Object Model (DOM) and how it allows programs and scripts to dynamically access and update the content, structure, and style of an HTML or XML document. It defines the DOM as a standard set by the W3C. The document then discusses the DOM for HTML documents (HTML DOM) and how it defines HTML elements as objects and provides properties and methods to access and modify those elements. It also discusses DOM events and how they allow JavaScript to add event handlers to HTML elements for user interactions.
This document provides an overview of HTML5 and XHTML2. It discusses the history of each standard, including periods where work took place outside the W3C. Key differences are that HTML5 focuses on evolving the existing web incrementally to support applications, while XHTML2 aimed to switch to a more declarative XML-based approach. HTML5 is natively supported in browsers, while XHTML2 likely remains most useful for server-side authoring.
This document discusses jQuery and web standards. It summarizes jQuery's goal of hiding browser compatibility issues while providing a simple API. It also discusses jQuery's success competing with other JavaScript libraries. The document outlines several specifications that are important to jQuery, with the DOM being the most significant. It then lists several standards and features that jQuery has used successfully. The majority of the document proposes additional standards and browser features that would be useful for jQuery and JavaScript libraries going forward, including better DOM manipulation APIs and event handling capabilities.
An introduction to HTML5 and its API's for the extream beginners those who already know what is HTML. Presentation also includes few features the CSS3.
I based my presention on the great "HTML5 for Web designers" by Jeremy Keith. Awesome and pragmatic book, the way I like it. Get your copy on: http://books.alistapart.com/products/html5-for-web-designers
Advanced guide to develop ajax applications using dojoFu Cheng
The document discusses developing Ajax applications using Dojo. It provides a brief history of web applications and introduces rich internet applications and Ajax. It then covers why Ajax is used, different Ajax application types, how Ajax changes web applications, and the anatomy of Ajax applications. The document also discusses semantic HTML, best practices for CSS, JavaScript concepts, DOM querying and manipulation using Dojo, efficient DOM techniques, events, and event propagation.
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith
The document discusses the history and development of HTML5. It notes that work began in the late 1990s and early 2000s to develop new web technologies, as HTML4 was over 10 years old. This led to specs like XHTML2 but also projects outside the W3C like Web Forms 2 and WHATWG, driven by browser makers. WHATWG was influential in developing many HTML5 features. The HTML5 spec was launched by the W3C in 2007, and defines features for embedding video/audio, canvas drawing, offline web apps, and more in a browser-independent way.
This document summarizes new features coming in major browsers, including Firefox 3.5, Safari 4, Internet Explorer 9, Opera 10, and Google Chrome 2. The browsers will have better JavaScript performance due to advanced engines like TraceMonkey, SquirrelFish, and V8. New features include process per tab, postMessage for cross-domain communication, getElementsByClassName, querySelectorAll, and HTML5 features like local SQL storage, JSON support, and canvas drawing.
Advancing JavaScript with Libraries (Yahoo Tech Talk)jeresig
1. JavaScript libraries abstract away browser differences and complex DOM APIs to provide simpler, more consistent interfaces.
2. New library patterns that emerged like DOM selectors and behaviors advanced development by managing cross-browser issues and establishing expectations around DOM manipulation.
3. Libraries build upon one another, with higher-level "meta-libraries" and domain-specific languages creating new programming paradigms on top of existing libraries and APIs.
It tells about how dom really used in javascript & html.And it tells about its levels and its w3c standards. And some Dom example programs with source code and screenshots.
The Document Object Model (DOM) is a standard for representing and interacting with objects in HTML, XML and SVG documents. It defines the logical structure of documents and the way a document is accessed and manipulated. The DOM represents the document as nodes and objects, which can be manipulated programmatically by JavaScript to change the document structure, style and content. It allows dynamic access to and manipulation of page content that is useful for building interactive web applications. The DOM specification is developed by the W3C and provides a platform- and language-neutral interface that can be used across different web technologies.
The document provides an overview of HTML5 forms, including new form attributes, input types, and elements. It discusses features like autocomplete, novalidate, and autofocus attributes that control form validation and autofilling. The document also notes that HTML5 makes marking up forms easier for developers and provides better consistency and performance for users by handling validation natively in the browser.
The document discusses the basic web security model, including browser content, the document object model (DOM), and the same origin policy. It provides details on how HTTP works with requests and responses between clients and servers. It also explains how web browsers function to display web pages and render HTML content. The DOM is described as an API that allows programs to interact with HTML documents and define their structure as a hierarchical tree of objects. Event handling and the same origin policy, which restricts interactions between pages from different origins, are also summarized.
This document discusses JavaScript frameworks and web components. It provides examples of code for Dojo, Ember, Angular, React, and jQuery. It also discusses the benefits of web components, including that they are part of the DOM, future-proof, and modular. Web components include custom elements, shadow DOM, templates, and HTML imports. Browser support is improving but not yet universal. Polyfills exist to provide support in older browsers. The web components specification has changed from version 0 to version 1 to support ES6 classes.
This document provides information on how browsers handle unknown HTML5 elements and the challenges presented, particularly with older versions of Internet Explorer. It discusses how browsers determine default styling and DOM structure for elements, and how Internet Explorer prior to version 9 does not allow styling or recognize elements it does not explicitly support. It presents a solution using JavaScript to dynamically create element nodes, tricking Internet Explorer into supporting unknown elements. It also shows a conditional comment method to apply this fix only for older IE versions.
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
This document is a presentation on HTML5 and beyond given by Tomoya Asai at JSiSE at Hokkaido University. The presentation covers the current state and future of HTML5, browsers, JavaScript APIs, and new web technologies. It provides examples and references to specifications, browser implementations, and demos related to HTML5 features such as semantic markup, forms, canvas, WebSockets, geolocation, and more.
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...Mario Heiderich
The clipboard is one of the most commonly used tools across operating systems, window managers and devices. Pressing Ctrl-C and Ctrl-V has become so fundamentally important to productivity and usability that we cannot get rid of it anymore. We happily and often thoughtlessly copy things from one source and paste them into another. URLs into address-bars, lengthy commands into console windows, text segments into web editors and mail interfaces. And we never worry about security when doing so. Because what could possibly go wrong, right?
But have we ever asked ourselves what the clipboard content actually consists of? Do we really know what it contains? And are we aware of the consequences a thoughtless copy&paste interaction can have? Who else can control the contents of the clipboard? Is it really just us doing Ctrl-C or is there other forces in the realm who are able to infect what we believe to be clean, who can desecrate what we trust so blindly that we never question or observe it?
This talk is about the clipboard and the technical details behind it. How it works, what it really contains – and who can influence its complex range of contents. We will learn about a new breed of targeted attacks, including cross-application XSS from PDF, ODT, DOC and XPS that allow to steal website accounts faster than you can click, turn your excel sheet into a monster and learn about ways to smuggle creepy payload that is hidden from sight until it executes. Oh, and we’ll also see what can be done about that and what defensive measures we achieved to create so far.
JSMVCOMFG - To sternly look at JavaScript MVC and Templating FrameworksMario Heiderich
The document discusses JavaScript MVC and templating frameworks and security issues found during penetration testing. Several frameworks were found to execute arbitrary JavaScript from markup in dangerous ways due to overuse of eval-like functions and lack of separation between code and content. This could lead to bypassing of content security policies. Metrics are proposed to evaluate frameworks on security practices like sandboxing and preventing injection into templates. While challenges exist, following best practices like strict separation of code and content could help frameworks improve security.
Scriptless Attacks - Stealing the Pie without touching the SillMario Heiderich
- The document discusses scriptless attacks that can bypass traditional XSS defenses like NoScript and XSS filters by leveraging new HTML5 and CSS features.
- It presents several proof-of-concept attacks including using CSS to steal passwords, using SVG fonts to brute force CSRF tokens, and using custom fonts to leak sensitive information like passwords without using JavaScript.
- The attacks demonstrate that even without scripting, features in HTML5 and CSS can be abused to conduct traditional XSS attacks and undermine security defenses, so more work is needed to protect against side-channels and unwanted data leakage from the browser.
This document summarizes Mario Heiderich's presentation titled "Locking the Throne Room - How ES5+ will change XSS and Client Side Security" given at BlueHat, Redmond 2011. The presentation discusses how new features in ECMAScript 5 (ES5), such as Object.defineProperty(), can be used to prevent cross-site scripting (XSS) attacks by locking down access to sensitive DOM properties and methods on the client-side in a tamper-resistant way. This moves XSS mitigation closer to the client where the attacks occur, avoiding issues caused by impedance mismatches between server-side filters and client-side execution. The approach could allow role-based access control and intrusion
The Image that called me - Active Content Injection with SVG FilesMario Heiderich
Mario Heiderich gave a presentation on active content injection using SVG files. He discussed how SVG files are XML-based and support scripting, allowing execution of JavaScript. This enables security issues like XSS. Browser implementations of SVG are inconsistent, with different levels of script support depending on how SVG files are deployed (inline, via <img>, etc). Exploits discussed SVG vulnerabilities in Firefox, Opera, and Chromium. Defense is difficult due to lack of documentation and filters, and new vectors are found weekly. Future work proposed a SVG purifier and raising awareness of issues.
Locking the Throne Room - How ES5+ might change views on XSS and Client Side ...Mario Heiderich
This document discusses using ES5 capabilities to help mitigate cross-site scripting (XSS) vulnerabilities. It summarizes the history of JavaScript and XSS, current approaches to mitigation, and limitations. It then proposes using ES5 features like Object.defineProperty to prohibit unauthorized access to DOM properties and add monitoring of property access. This could enable intrusion detection and role-based access control without impedance mismatches. Examples show freezing DOM objects to prevent tampering. Limitations include blacklisting and compatibility issues, but the approach aims to detect and prevent XSS at the client level without server-side filtering.
Dev and Blind - Attacking the weakest Link in IT SecurityMario Heiderich
The developer is an easy and valuable target for malicious minds. The reasons for that are numerous and hard to come by. This talk delivers examples, proof, discussion and awkward moments in a pretty special way.
Everybody hates developers – especially web developers. And why not? The cracks and crevices of their APIs and implementations are the reason that vulnerabilities in web applications are still a widespread issue – and will continue to be in the foreseeable future.
Bashing and blaming them for their wrongdoings is fun – boy, they are stupid in their mistakes! But has anyone ever dared to have an open on stage battle with an actual developer?
And who of the developers dares to face their collective nemesis – the attacker? Can there be life where matter and anti-matter collide? We will know about this soon – because this is what this talk is going to be about. Developer versus attacker – vulnerability versus defense. Be prepared for swearing, violence and people leaving the stage prematurely in tears.
This document provides an overview of HTML5 including its history, current status, implementation in browsers, and both benefits and security issues. It discusses how HTML5 aims to simplify and enhance usability but also introduces new vulnerabilities due to its dynamic nature forcing rapid implementation. While HTML5 enables rich content and interactivity, its inconsistencies and evolving specifications combined with a rush for browser support has resulted in buggy websites and potential for attacks like hijacking forms, stealing data, and bypassing security restrictions.
I thought you were my friend - Malicious MarkupMario Heiderich
The document is a transcript from a talk given by Mario Heiderich at the CONFidence 2009 conference. It discusses various ways that malicious code can be embedded in markup and exploited by browsers, including through techniques like inline SVG, XML namespaces, XUL artifacts, and more. It provides examples of actual malicious code and encourages awareness of legacy browser vulnerabilities as new web standards are developed.
This document discusses current and emerging web attacks. It notes that while cross-site scripting (XSS) and SQL injection attacks were once prevalent, modern web applications and browsers incorporate defenses against these attacks. However, the document argues that web applications and browsers are evolving in ways that enable new types of multi-layer attacks. Examples are provided of attacks that combine layers like the database management system, JavaScript execution in browsers, and HTML parsing quirks to bypass defenses. The document urges security researchers and practitioners to consider these evolving attack techniques and the growing diversity of client devices and applications.
This document summarizes Mario Heiderich's talk on obfuscated JavaScript malware. The talk covered the history of JavaScript and how it has evolved from being frowned upon due to security issues to becoming essential for modern web applications. It then discussed how JavaScript is commonly used in malware through techniques like string obfuscation, eval injection, and hiding payloads in the DOM. The talk concluded by exploring how obfuscation could become even more advanced using new JavaScript features and discussed challenges in detecting obfuscated malware.
This document summarizes a talk given by Gareth Heyes and Mario Heiderich on web security and the PHPIDS project. It describes the early challenges of detecting attacks using simple blacklists and how the project evolved to address increasingly complex obfuscated payloads. Key points discussed include the introduction of a payload canonicalizer to normalize strings before detection, ongoing challenges of new browser behaviors and standards, and the importance of an open community approach to security research.
Mario Heiderich presents on generic attack detection using PHPIDS. PHPIDS uses 70 regex rules to detect attacks like XSS and SQLi by analyzing user input. It first normalizes the input, then detects patterns through a conversion and detection process, and can log or report any findings. PHPIDS aims to avoid blacklisting traps through this generic approach. Future work may include optimizing existing detection routines and adding more granular analysis techniques.
Concept and purpose of community diagnosisfelixsakwa55
Objectives of the session
• By the end of this class, you will be able to:
• Describe the concept and purpose of community
diagnosis
• Explain how to plan a community diagnosis
survey
• Describe how to develop and pre-test tools for
data collection
• Explain how to execute a survey
• State how to write and disseminate a community
diagnosis report and plan community action
Concept and Purpose of Community
Diagnosis
Introduction
When you care for an individual patient, you make
a patient diagnosis and organize the appropriate
treatment.
Similarly, in order to look after a community, you
must make a community diagnosis and organise
appropriate community health programmes.
It is therefore important for you to learn the
approaches to community diagnosis and what its
purpose is, and how it differs from patient
diagnosis.
The Concept of Community
Diagnosis
• Community diagnosis is a process through
which health workers together with members
of the community identify the community’s
priority health problems, and together make
plans of action and implement them.
• It points out where the health services should
put their main efforts and resources.
The Concept of Community
Diagnosis…
• The community diagnosis concept therefore
stresses that the community must identify its
problems, prioritize them and draw a plan of
action to address the identified problems.
• The community then implements this plan to resolve
the problems.
• It emphasizes total community involvement. This is
because the community knows its problems and
priorities better than the health worker.
• When they actively participate in solving
these issues, they become bound by the
decisions they make and feel motivated to
see the plans through.
Community diagnosis…
• In community diagnosis, you follow the
same basic steps as the ones you do in
patient diagnosis.
• The only difference is that the amount of
data is much greater and requires more
lengthy analysis and processing.
• In community diagnosis you start by
collecting basic information.
Community diagnosis…
• You collect information about the following:
Local people and their environment
The number of people and their distribution
The diseases the local people suffer from
The organization of local health services
Community diagnosis…
You then make a community diagnosis by
identifying the main health problems and the
reasons for them.
Identify priority health problems and plan a
community health programme or treatment to
solve these problems.
Importance of selecting priority health needs/
problems.
This is because health centres often have limited
resources and many demands on those resources.
There are simply not enough resources to solve all
the health problems in the community.
Therefore, you as the health care worker together
with the community must select priorities for
health action.
• It is important to choose only those problems
that the
APNIC Update - Global Synergy among the RIRs: Connecting the RegionsAPNIC
Vivek Nigam, APNIC Regional Manager, Member and Registry Services, presented an update on APNIC's IPv4 resources and registry challenges at LACNIC 43 held in São Paulo, Brazil from 5 to 9 May 2025.
The session will cover some recent DDoS trend and vulnerable ports in BD. It recommends some strategies to protect ISPs and network operators against DDoS attacks while dealing as a victim as well as as part of the attack.
Measuring Starlink Protocol Performance, presented at LACNIC 43APNIC
Geoff Huston, Chief Scientist at APNIC, presented on 'Measuring Starlink Protocol Performance' at LACNIC 43 held in São Paulo, Brazil from 5 to 9 May 2025.
Internet Exchange Points, presented at Peering Workshop at the PITA 29th AGM,...APNIC
Terry Sweetser, APNIC's Training Delivery Manager, South Asia & Oceania, co-facilitated the Peering Workshop at the PITA 29th AGM, Business Forum, and Expo held from 29 April to 2 May 2025 in Honiara, Solomon Islands.
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdfDana Luther
Heard a lot about docker but not sure where to start? Frustrated maintaining development VMs? In this presentation we will go over the simplest ways to convert your development environment over to a docker stack, including support for full acceptance testing with Selenium. We’ll then go over how to modify the stack to mimic your production/pre-production environment(s) as closely as possible, and demystify working with the containers in the stack.
The Art of API Design - PHP Tek 2025, Chris TankersleyChris Tankersley
In the world of web development, creating an API that users will love involves more than just providing access to data. It requires thoughtful design, efficient performance, and a clear understanding of user needs. In this talk, we'll dive into the principles of designing and building APIs that prioritize user experience. From choosing the right PHP tools to implementing RESTful practices and documentation, we'll explore the key components of a developer-friendly API. Whether you're building an API for internal use or external consumption, this session will provide you with the insights and strategies to create an API that delights your users. Or at least make them more likely to pay for your product.
Navigating Compliance for MSPs From First Audit to MonetizationControlCase
You’ll gain a clear understanding of why compliance is essential to differentiating your service portfolio, explore key frameworks like SOC 2 and GDPR tailored to MSP operations, and learn actionable strategies to prepare for and excel in your first audit. You’ll also have the opportunity to engage directly with industry leaders—Natalie Suarez from ConnectWise, and Patrick Jamison and Ricardo M. Pardo from ControlCase—who will share best practices for audit readiness and reveal how to turn compliance into a powerful revenue stream. Spaces are limited, so register now.
As networks increasingly demand faster convergence and enhanced resilience, Segment Routing over MPLS (SR-MPLS) has emerged as a robust framework to simplify traffic engineering and improve failure recovery. This technical session will delve into Fast Reroute (FRR) mechanisms within SR-MPLS, with a focus on Topology Independent Loop-Free Alternate (TI-LFA). I will explore how TI-LFA enables sub-50ms protection against link and node failures while ensuring optimal coverage across any topology.
The talk will also address key challenges like microloop formation during convergence and discuss practical strategies for microloop prevention using SR policies and ordered FIB updates. Through real-world examples and lab-tested topologies, attendees will gain a deeper understanding of how to design and deploy scalable, fast-converging SR-MPLS networks with high availability and minimal service disruption.
The Domain Name System (DNS) is a critical part of the Internet infrastructure. DNS translates the domain names of websites and email addresses that people can remember to the IP addresses that computers can understand. It is a large distributed system with many moving parts.
KINDNS is simple framework for stable and secure DNS operations. The KINDNS guidelines are current best practices for DNS operators to improve the security and reliability of their operations.
The Domain Name System (DNS) is a critical part of the Internet infrastructure. DNS translates the domain names of websites and email addresses that people can remember to the IP addresses that computers can understand. It is a large distributed system with many moving parts.
KINDNS is simple framework for stable and secure DNS operations. The KINDNS guidelines are current best practices for DNS operators to improve the security and reliability of their operations.
This presentation explores the collaboration between advanced cybersecurity tools and human expertise. While automated tools enhance vulnerability detection, skilled professionals are essential for understanding complex attacks and adapting to emerging threats. Combining both elements strengthens an organization's defense, improving overall cybersecurity resilience.
Regional Development for an Open, Stable, and Secure InternetAPNIC
Jia Rong Low, APNIC Director General, presented on 'Regional Development for an Open, Stable, and Secure Internet' at the PITA AGM, Business Forum, and Expo held from 29 April to 2 May 2025 in Honiara, Solomon Islands.
Prop-154: Resizing of IPv4 assignments for IXPsAPNIC
Vivek Nigam, APNIC Regional Manager, Member and Registry Services, presented on resource delegations for IXPs at the PITA 29th AGM, Business Forum, and Expo held from 29 April to 2 May 2025 in Honiara, Solomon Islands.
The operational environments of ISPs and service providers—particularly Network Operations Centers (NOCs) and support teams—are increasingly overwhelmed by repetitive communication, documentation, and content creation tasks. At BdREN, we encountered similar challenges while managing high volumes of client emails, drafting incident communications, and facilitating digital learning across our network. In response, we developed AI-powered tools not only for the education sector but also to streamline our internal operations—challenges shared by many ISPs.
This talk presents a practical and ISP-relevant perspective on how BdREN is integrating Artificial Intelligence to automate repetitive yet critical tasks. Key use cases include:
An AI-based email assistant that intelligently generates replies, summarizes conversations, and drafts new messages to support overloaded NOC and helpdesk teams.
A quiz generation system that transforms documents into ready-to-use assessments in seconds, addressing one of the most time-consuming tasks in training and academic operations.
In addition to showcasing these innovations, the session will outline our roadmap for AI-assisted assessments, content analytics, and collaboration opportunities with ISPs and research networks alike. Whether you're managing clients, students, or support workflows, these solutions offer replicable and scalable models for operational efficiency.
The session includes live demonstrations and real-world examples aimed at inspiring local ISPs to explore how AI can be embedded into everyday technical workflows—beyond the buzzwords.
The technology and internet industry is a fascinating, fast-paced environment that drives innovation and shapes the world. However, behind the glamorous fasade of startups, tech giants, and digital pioneers, there is often a reality filled with immense pressure, high expectations, and mental health challenges.
In my presentation, I want to share my personal story of an honest look at my life and career in the tech industry. I will highlight the challenges I've encountered, the problems I've faced firsthand, and the impact workplace culture has had on my mental health. It's not just about the difficulties but also about potential solutions and ways to create a more people-friendly industry.
Every individual experiences their career in this industry differently. However, there are recurring patterns and systemic issues that affect many of us. With my presentation, I aim to raise awareness, encourage reflection, and spark discussions: What is wrong? What is working well? Where can we collaborate to create positive change?
As part of this initiative/ presentation, I will also introduce my passion project "Open Ears" a platform dedicated to active listening and open exchange within the tech industry. Through this initiative, I hope to encourage colleagues to share their experiences, seek support, and collectively contribute to a healthier workplace culture.
My goal is not only to provide a personal perspective but also to initiate a dialogue about the urgent need for change in our industry.
1. In the DOM,
no one will hear you scream
A journey into the moldy layer
between HTML and JavaScript
A talk by Mario Heiderich
[email protected] || @0x6D6172696F
2. Meta-Expert, Philanthropist, Visionary
& Thought-Leader
● Dr.-Ing. Mario Heiderich
● Researcher and Post-Doc, Ruhr-Uni Bochum
– PhD Thesis about Client Side Security and Defense
● Founder of Cure53
– Pentest- & Security-Firm located in Berlin
– Consulting, Workshops, Trainings
– „Simply the Best Company in the World“
● Published Author and Speaker
– Specialized on HTML5, DOM and SVG Security
– JavaScript, XSS and Client Side Attacks
● HTML5 Security Cheatsheet
● And DOMPurify!
– @0x6D6172696F
– [email protected]
3. Today's Menu
● The DOM (Document Object Model)
● Especially its weirder areas
● Origin and Goals
● History and first implementations
● Traps and Pitfalls
● Security Issues
● Countermeasures against those
● An Outlook
● No JavaScript-”Weirdness”
● No undefined==null and so on
● We'll stick with the DOM itself - the “Layer Between™”
● Focus on security for modern web apps
5. Ancient History
● The DOM as we know it today has made a very long way
● Baby steps were made as early as back in 1995
● „Legacy-DOM“ or DOM Level 0
● Implementations in Netscape 2.0 and MSIE 3.0
● No actual standard. And why would there be any.
● Partial documentation
● No common denominator among browsers
● JavaScript versus JScript
● Poor on features, no actual feature-parity to HTML
● Goals of that early DOM?
● Interactivity and easy element-access
● document.forms[0].elements[0]
● document.bla.blubb
7. The Intermediate-DOM
● After Legacy DOM there was a short intermediate phase
● The year we're in? 1997
● The browsers in control? MSIE and Netscape 4.0
● Implemented is the so called “Intermediate DOM”
● MSIE and Netscape place their bets on DHTML
● „Dynamic HTML“
● More APIs to influence HTML via JavaScript
● But still no standard in sight
● Any why would they, it's a browser war anyway
● So we're essentially talking about “DOM Level 0+”
● Still nothing spectacular, a niche in a niche
8. Now, DOM Level 1
● In the year 1998 DOM 1 reached recommendation status
● W3C DOM Level 1. slim but better than nothing
● After 4 years, finally something standard-like emerges
– http://www.w3.org/TR/REC-DOM-Level-1/
● Available components were „Core“ and „HTML“
● “Naming Conventions”
● “Document Structure”
● “Case Sensitivity”
● “Memory Management”
● “Processing Instructions“
● Interfaces defined via IDL
● Interface Description Language, Web IDL
● Still very XML-heavy, no trace of today's HTML
● CDATA, Entities, Notations, etc. etc.
9. Conformity?
● What use is a standard if no one implements it?
● And did browser implement is?
● Nooope. And, as said, why would they.
● document.all in MSIE
● document.layers in Netscape
● elm.innerHTML – first in MSIE then copied all around
● ActiveX and... GeckoActiveXObject (okay, that got canceled)
● VBScript, the language from outer space
● MSIE5 shipped full DOM 1 Support. But tons of extras and deviations too
● Many of which are now also part of the standard
● JavaScript versus JScript again
● Even today we witness relics of that time
● location('vbscript:msgbox(1)')
● location.href = 'javascript:alert(1)'
10. DOM Level 2
● Published by the W3C in late 2000
● http://www.w3.org/TR/DOM-Level-2-Core/
● Enriched with the following modules
● “Core”, „HTML“, „Events“, „Style“, „Views“ etc.
● Better separation of the single satellite standards
● For instance DOM Level 2 Events
● http://www.w3.org/TR/DOM-Level-2-Events/
● Several small but important changes
● document.getElementById() for all document types
● Before that available HTML-only – alternative was „Traversal“ and ”Direct Access”
● Oh yes, and events of course
● „Something happens in case something occurs“
● document.createEvent() etc.
● Otherwise stagnation, over at W3C the climate decreased
● Developers and Browser-Vendors wanted more. Much more.
● And so they just planned and built it in themselves.
11. Features in MSIE5
● A lot of things we consider hip these days
● Favorites, MHTML, Data Islands, XHR, XDR
● ActiveX, WD-XSL, Media Player, Toolbars
● HTA, Conditional Compilation, Active Desktop
● Cursor Capture, own Java VM, XMLDOM
● Bidi-Text, Ruby Characters, Language Encoding
● VML, SAMI, SMIL, CSS Filters, Page Transitions
● DOM Behaviors, WebControls, HTML+TIME
● Media Bar, Radio Bar, Persistence, HTC, TDC
● Scriptable Editing, Viewlink Behaviors, DesignMode
● Many of those disappeared
● Some stayed though
● Others are hidden behind IE's “Docmodes”
13. DOM Level 3
● The W3C continues moving slowly. Very slowly.
● DOM3 meanders into position to take off. Slowly.
● Specified in 2004, so now about ten years old
● Same year, the WHATWG was created and gained ground
● Coincidence? Maybe. Maybe not.
● No more slow-moving, XML-bound W3C?
● Some great ideas by WHATWG, and some less ideal ones
● Web Workers, Web Forms 2.0, “Living Standard”
● DOM3 is still XML-heavy
● XML Serialization, XPath Support
● And finally Keyboard Events
● „The DOM Level 2 Event specification does not provide a key event module.
An event module designed for use with keyboard input devices will be included
in a later version of the DOM specification.“
14. Rise of the Triad
● Prototype
● First release in 2005
● “Monkey Patching”, extending the DOM
● Implements what's missed by developers
● jQuery
● First release in August 2006
● Fast and reliable access to DOM APIs
● Avoiding browser-specific code
– Conditional Comments, CSS Hacks, A Pis
– Conditional Compilation
● MooTools
● First release in September 2006
● OOP in JavaScript
● Extending the Element constructors
● More control over HTML via JavaScript –
yet another DOM so to say
16. The DOM Today
● Specified by the W3C and others as DOM Level 4
● And also by WHATWG, and a bunch of other vendors
● window.btoa() „DOM Level 0. Not part of any standard. Except of course
http://www.whatwg.org/specs/...“
● „Many DOMs“, one goal: API between structure and logic
● HTML DOM
– http://www.w3.org/TR/dom/
– http://dom.spec.whatwg.org/
● SVG DOM
– http://www.w3.org/TR/SVG/svgdom.html
– http://www.w3.org/TR/SVG2/svgdom.html
● PDF DOM
– http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf
● XML DOM
– http://msdn.microsoft.com/en-us/library/hf9hbf87%28v=vs.110%29.aspx
● MathML DOM
– http://www.w3.org/TR/MathML2/chapter8.html
● And not to forget – many satellite-specs
● http://www.w3.org/TR/#tr_DOM
17. And then JSMVCOMFG
● JavaScript Model-View-Controller Frameworks
● Many developers still yearn for more DOM features
● Web Components coming up slowly. Too slow?
● DOM itself to weak for large scale applications?
● No programmatic templating yet
● No clean separation of code and content
● No good re-usability
● Hard-to-use i18n
● So there's a trend towards JSMVC
● Or jsMvvM or MVW or...
● “Super-heroic Frameworks”
● Extend HTML's powers
● Lock people away the DOM
● Force-feed individual interfaces
● JSMVC Security https://code.google.com/p/mustache-security/
18. But now let's get to it
● We have seen the following
● The DOM developed over more than one decade
● Meanwhile the API is huge
● Sometimes simple and intuitive
● Sometimes complex, counter intuitive and congested
● Still, without the DOM, nothing moves in the modern web
● What we want to see now
● Well, how about the parts where „no one can hear you scream“?
● Where can we find behaviors that are risky
● How can we spot those behaviors
● And when does security come into play?
● Maybe even a small „0ld-Day“ for illustration?
● So, let's get started!
19. String-to-Code
● The DOM is overflowing on ways
to turns strings into code
● Be it HTML or direct JavaScript
● Some of them are classics
● Other not too well known
● Then others rather hidden
● Result? Usually DOMXSS
● Let's have a look at a list of those
● Just as a small warm-up
● And then have a look at more
exotic cases
21. DOM Clobbering
● Not the most well-known attack technique
● Yet pretty effective if the stars are aligned well
● Anyone knows the term already?
● I think it was Gareth who coined it back then...
● There's not too much documentation available
● But the attacks can be fierce and hard to mitigate!
● So, who still remembers the site jibbering.com?
● “Unsafe Names for HTML Form Controls”
● http://jibbering.com/faq/names/
● And that is the very essence of DOM Clobbering
22. “Browsers also may add names and id's of other
elements as properties to document, and sometimes
to the global object (or an object above the global
object in scope).
This nonstandard
behavior can result in
replacement of properties on other objects. The
problems it causes are discussed in detail.”
25. Soooo...
● Some attributes of FORM elements spawn global references
● And often, we can create child properties using certain attributes
● And we can even assign strings to these child properties
● Jibbering.org calls these „Shortcut Accessors“
● http://jibbering.com/faq/notes/form-access/#faShrt
● But it doesn't work in any case of course
● For most browsers, the attribute name must match an existing property
in the element's constructor
● Meaning – FORM knows action but not blafasel
● So we can clobber action - but blafasel we cannot
● Such a disappointment!
● And that's probably the case for each and every browser, right?
● Riiight?
26. No, not MSIE!
● On MSIE, we can also introduce children by using unknown
attributes
● Meaning, properties that are unknown to the element's constructor
● But only if the page is loaded in an older „docment mode“
● Who still remembers document modes?
● Exactly, the “solution” for compatibility problems and broken layouts
● New MSIE, old engine, activate docmode via Header or META tag
There,
IE8 Mode
27. Influencing Docmodes
● So, a page you want to clobber is in Edge-Mode?
● You can just load it in an Iframe in IE8-Mode
● It will adopt the docmode of the parent/top page
● (X-Frame-Options protects: https://cure53.de/xfo-clickjacking.pdf )
<form id=abc def=123>
</form>
<script>
alert(abd.def)
</script> <meta
http-equiv=x-ua-compatible
content=IE=8
> <iframe src=clobber.html>
No dice
Yes
dice :)
32. So, attackers can...
● Use harmless HTML to severely influence the
DOM
● For example to create new properties and child
properties in the global scope
● Overwrite existing variables
● In case they have not been initialized
● Or passed as an argument
● Well, that's fair enough
● But it's getting even better...
33. Again our friend MSIE
● Just for older versions
● But still...
<form id="document" cookie="123"></form>
<script>
alert(document.cookie)
</script>
<form id="location" href="javascript:alert(1)"></form>
<script>
alert(location.href)
</script>
34. DOM Clobbering Attack
● Now, let's have a look at an actual security bug
● It existed for years in the code of a popular RTE
● We're talking about the software called „CKEditor“
“The best web text editor for everyone”
“World class quality”
“High standard of quality”
● Proper level of modesty, always good...
● Let's watch a Demo (PoC below)
<a href="plugins/preview/preview.html#<svg
onload=alert(1)>" id="_cke_htmlToLoad"
target="_blank">Click me for dolphins!</a>
35. The vulnerable Code
/plugins/preview/preview.html
<script>
var doc = document;
doc.open();
doc.write( window.opener._cke_htmlToLoad );
doc.close();
delete window.opener._cke_htmlToLoad;
</script>
36. To wrap it up...
● The attack works for the following reasons
● We have a document.write()
● We have implicit access to opener
● We can influence a globally scoped „variable“
● We actually have full (string) control via <a>+ id
● <a> + toString() = Content of the href attribute
● Encoding peculiarities for window.location help us
– Some browsers encode special characters (Firefox)
– Some do not (IE, Chrome, Safari, Opera, ...)
● Result: XSS via DOM Clobbering
37. One Security Problem
● The whole things points at a general problem
● We do have great XSS filters on the server
● HTMLPurifier, SafeHTML, AntiSamy etc.
● But we don't have much in the browser
● Okay, MSIE has toStaticHTML()
● Then we have XSS-Filters in the browser, IE, WebKitWebKit/Blink, NoScript
● And there's a bunch of hacks and whacks
● Sandboxed Iframes might be a way as well
● Then jSanity.. but it never got released
● So we were like.. let's build something
● CANNOT BE SO HARD RITE!!1
● Just quickly write some client-side XSS filter
38. DOMPurify, a solution?
● So we need a new tool, let's write it
● And solve client-side issues where the happen
● In the client itself. Yeah!
● XSS filter written in JavaScript, running on the DOM
● Simple API. Dirty string in, clean string out
● Why in the client? Because of the „knowledge parity“!
● Servers cannot solve XSS since they don't know the client
● This is fundamentally important! Always keep that in mind!
● The sever can only try to understand the client
● And provide protection as good as possible. But never 100%
● And sometimes there is no server, then what?
● Offline-Applications
● Apps and Widgets
● Web Crypto! Mailvelope for example, PGP in the browser
39. Again, because it's really so important.
Server-side XSS protection cannot guarantee
100% safety. It's impossible by design
41. Protect against XSS. Easy.
● DOMPurify tries to be as tolerant as possible
● Permit everything that doesn’t hurt. Literally everything.
● Very generous white-list
● Known as secure? Is allowed!
● Not sure or unknown? Blocked!
● Available for HTML, SVG and MathML!
● And whatever ?ML people might come up with
● Even works with Shadow DOM, we'll see that later
● Secure default, Config-API for customizations
● Technological base for the tool is as follows:
● document.implementation.createHTMLDocument()
● document.createNodeIterator()
● document.removeChild()
● document.removeAttributeNode()
● Final serialization and return of the sanitized string. Or DOM.
42. The DOM, an old Buddy.
● That all sounds quite easy, right?
● XSS solved in the client. Shwoops, done.
● But the DOM decided to take revenge on us. Back-stabbed us.
● So, a security library must be able to withstand attacks
● And the attacker can use whatever she finds in the DOM
● Peculiarities turn weaknesses, weaknesses turn vulnerabilities
● And vulnerabilities turn into exploits
● And that happened.
● The work on DOMPurify showed us, what incredible mess the
DOM really is.
● Let's now have a close look at that...
43. 1. DOM Clobbering
● The DOMPurify Pre-Alpha was tested thoroughly before release
● And broken several times. Painfully broken too.
● But the first bypasses had nothing to do with XSS
● But with the DOM, its behavior and the weirdness to it
● Which eventually leads to XSS as we already saw
● So, ladies and gentlemen, what would this snippet of markup do?
<div onclick=alert(0)>
<form onsubmit=alert(1)>
<input name=parentNode>123
</form>
</div>
44. 1. The Effect
● Our code used the property parentNode, see below
● This property however does not exist anymore in its original form
● It got overwritten by its own child element!
● child.parentNode === child // wtf, DOM!
● Unfortunately we need the parentNode property
● So we need to... authenticate and verify parentNode
● Is it that child.parentNode === child? Yes? Potential attack!
/* Remove element if anything prohibits its presence */
currentNode.parentNode.removeChild(currentNode);
45. 2. “Clobbering” Attributes
● That was already pretty nasty
● But it gets a lot worse
● As a security-library we of course have to cover HTML attributes
too
● And, if necessary, safely remove them to prevent XSS
● Now let's have a look at the following bypass
<form onmouseover='alert(1)'>
<input name="attributes">
<input name="attributes">
</form>
46. 2. The Effect
for (var attr = elm.attributes.length-1; attr >= 0; attr--) {
tmp = elm.attributes[attr];
clobbering = false;
elm.removeAttribute(elm.attributes[attr].name);
...
● Our code iterated over attributes to find out which ones exist
● And then to check their values
● But what if attributes is suddenly an HTML element?
● Then the code breaks, XSS is nigh
● So we have to go and check again
● if(typeof elem.attributes.item === 'function') …
● Looks okay, right?
47. 2. Yeah, well...
● Our checks looked nice at first, but they were rubbish!
● Because there was another bypass!
<form onmouseover='alert(1)'>
<input name="attributes">
<input name="attributes">
</form>
● Now, the property attributes consists of two HTML elements
● And therefore it's a NodeCollection
● Which then again has the method items() exposed
● XSS! Dammit! So we need an even better check!
48. 3. And it goes on like that...
● We learned that iterating is not as easy as it seems
● In the early phases on DOMPurify, we saw weird
artifacts
● Element has three attributes, two were removed
● Went great for one. Then others turned invisible. And were
not caught by our loop
● All fine we thought, wrote the element back to the DOM
● And „flooop“, the invisible attribute was back!
<div wow=removeme onmouseover=alert(1)>text
49. 3. Gotta go backwards
● We have to remove attributes „backwards“. So starting
with last and iterating on to the first
● Otherwise the browser has to re-sort! And thereby the
index breaks and we have invisible attributes
● Invisible, but still there.
// wrong
for (var i = 0; i <= elm.attributes.length; i++) {
elm.removeAttribute(elm.attributes[i].name);
// right
for (var attr = elm.attributes.length-1; attr >= 0; attr--) {
elm.removeAttribute(elm.attributes[attr].name);
50. 4. Document Clobbering
● Another trick that was used against us was evil
images
● DOM Clobbering at its best, look at this!
<img src=bla name=getElementByID>
<image name=activeElement><svg onload=alert(1)>
<image name=body>
<img src=x><svg onload=alert(1); autofocus>,
<keygen onfocus=alert(1); autofocus>
51. 5. Mutations or mXSS
● Again, mXSS is a huge issue, also in modern browsers
● We know that some properties get mutated and trigger XSS,
invisible to the server
● http://cure53.de/fp170.pdf
● Among those properties are innerHTML or textContent, cssText
● and many others
● And again, DOMPurify could be bypassed using those tricks
<listing>
<img onerror="alert(1);//" src=1><t t></listing>
<img src=x id/=' onerror=alert(1)//'>
123<a href='u2028javascript:alert(1)'>I am a dolphin too!</a>
52. Security in the DOM?
● Doesn't really exist. Yet. We're getting there though!
● The following need to be kept in mind
● DOM Clobbering, verification of properties
● Overwritten and deactivated methods
● Mutating values, mXSS
● Protocol-Handlers using Unicode (weird Chrome bug)
● Iteration in the right order
● Verification of changes. Verification all the time
● Proper reaction to anomalies
● With DOMPurify we came quite far
● But there's no 100% security yet
● And then there's still jQuery and friend, oh noez!
● And that's we we start at zero again. F****g jQuery!!1
54. Facts
● jQuery is obviously used... quite a lot
● About a fifth of all websites worldwide. A fifth!
● jQuery haunted by „Ghosts of XSS-mas Past“
● Remember the debacle around $(location.hash)
● Or $('<svg onload=alert(1)>')
● The $-Factory, that not only selects and wraps but builds a DOM
● And of all properties uses innerHTML and a DIV to map
● But it gets worse
● Let's have a look at the following attack vector
<option><style></option></select><b><img src=xx:
onerror=alert(1)></style></option>
55. And now what?
● Technically the vector is harmless. Cannot execute JavaScript
● And doesn't. And shouldn't.
● But once jQuery is present, things change because jQuery is
„smart“ and wraps for conformity
// We have to close these tags to support XHTML (#13200)
wrapMap = {
// Support: IE 9
option: [ 1, "<select multiple='multiple'>", "</select>" ],
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
_default: [ 0, "", "" ]
};
56. So?
● Now, our harmless HTML string turns into
something very much different
● Look at this!
// Original
<option><style></option></select><b><img src=xx:
onerror=alert(1)></style></option>
// Result
<select multiple="multiple">
<option><style></style></option>
</select>
<b>
<img src="xx:" onerror="alert(1)" />
</b>
57. And there's even more...
● Thanks, jQuery, for the night shifts.
● DOMPurify now has a „Safe for jQuery“ mode
● But similar craziness can be done using the Shadow DOM
● With the new <template> element for instance
● Although this element technically has child element, we cannot just
iterate over them. Because they are stored on elm.content.
<template id="tpl">
<b>Heya!</b>
</template>
<script>
tpl.childNodes // Is empty, no child nodes
tpl.content.childNodes // Ah! There's our element!
</script>
58. Protect thy selves
● So, what can we do to protect ourselves?
● At the server-side level
● Classic XSS „protection“ is not enough
● ID and NAME have to be removed from user-generated markup
● CLASS can get dangerous, when MVC are mixed in
● Don't even build black-lists, White-lists are the only working approach
● At the client-side level
● Clobbering is the biggest risk so far
● It's easy to get a fresh DOM but hard to keep it reliable
● Clobbering even happens in document.implementation
● Classic XSS Bugs will disappear in the next years
● Direct and indirect attacks against the DOM will become more prevalent
● So better get on track right now!
● The „XSS N1nja L33t Haxor bounty“ party is gonna be over soon
59. Conclusion
● Proper DOM security is hard
● Understanding the DOM is often hard as well
● Traversal fails, transactions fail
● Elements disappear, new elements pop up
● Without a string JavaScript/DOM Debugger you won't get far
● Browsers still do their own thing here and there
● However, first baby-steps were made
● Documentation, Libraries, Browsers actually fix standard deviations
● https://github.com/cure53/DOMPurify
● https://github.com/cure53/jPurify
● Still, we kind of need a community wiki
● And collect all those crazy artifacts in one place
● And discuss the security implications
● Maybe this? https://github.com/cure53/xss-challenge-wiki
● There's new features coming every day
● And the DOM develops fast(er than anything else in the WWW)
60. The End
● Question?
● Comments?
● Thanks a lot!
● And special thanks to all contributors and
breakers of DOMPurify!