<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jweiler</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jweiler"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Jweiler"/>
		<updated>2026-05-25T18:14:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Boston&amp;diff=251950</id>
		<title>Boston</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Boston&amp;diff=251950"/>
				<updated>2019-05-28T15:55:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Boston OWASP Chapter Leaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Boston|extra=Follow @OWASPBOSTON on Twitter. The chapter leader is [mailto:boston@owasp.org Jim Weiler]. The Boston chapter is grateful for support from Constant Contact, Salesforce, Microsoft and Akamai for generously hosting space and their hospitality for various events.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
The Chapter would also like to thank our sponsors for their generous support.|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Boston|emailarchives=http://lists.owasp.org/pipermail/owasp-Boston}}&lt;br /&gt;
&lt;br /&gt;
== Chapter Sponsor ==&lt;br /&gt;
[[File:SIlogostacked.png|Security Innovation|https://www.securityinnovation.com/]]&lt;br /&gt;
&lt;br /&gt;
[[File:Veracode logo.png|Veracode|https://www.veracode.com/]]&lt;br /&gt;
&lt;br /&gt;
== Boston Application Security Conference ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Boston-Banner-468x60.gif|link=2018_BASC_Homepage]] [[Image:twitter_32.png|link=https://twitter.com/@BASConf]] BASC 2019, the Boston Application Security Conference will take place 8:30am to 6:30pm on Saturday, October 19th at Microsoft, 5 Wayside Road, Burlington, MA.  [[2018 BASC Homepage|Read more]]&lt;br /&gt;
&lt;br /&gt;
== Chapter Meetings --- Our Fifteenth Year ==&lt;br /&gt;
&lt;br /&gt;
We now use [http://www.meetup.com/owaspboston/ meetup] to organize meetings.&lt;br /&gt;
&lt;br /&gt;
We meet whenever a speaker and a venue have available dates,  6:30 to 9 pm. &lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to come to any meeting, there is no signup or joining criteria, just come if it sounds interesting. You can join the OWASP Boston Google group at https://groups.google.com/a/owasp.org/forum/#!forum/boston-chapter. This list is very low volume (2 - 3 emails/month); it is used to remind people about each monthly meeting, inform about local application security events and special chapter offers. &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Information for meeting updates about this and other Boston area user groups can also be found at [http://bug.bostonusergroups.org/Lists/Groups%20Calendar/calendar.aspx BostonUserGroups]. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upcoming Meetings&lt;br /&gt;
&lt;br /&gt;
 '''May 22, 2019''' - Watertown [https://web.securityinnovation.com/athenahealth2019 CMD+CTRL Web App Hacking Cyber Range 6:00-9:00pm  Partnered w/Security Innovation &amp;amp; Athenahealth]&lt;br /&gt;
&lt;br /&gt;
YOU CAN ONLY REGISTER ON THE SECURITY INNOVATION REGISTRATION SITE AT [https://web.securityinnovation.com/athenahealth2019 THIS LINK]&lt;br /&gt;
&lt;br /&gt;
Location: [https://goo.gl/maps/rTHhZcawAX1jYnhP7 Athena Health Watertown]&lt;br /&gt;
&lt;br /&gt;
6PM *sharp*- '''Just bring your computer and evil inner-doer and you are ready to roll!'''&lt;br /&gt;
&lt;br /&gt;
Want to test your skills in identifying web app vulnerabilities?  Join OWASP Boston, Athena Health and Security Innovation as members compete in CMD+CTRL, a web application cyber range where players exploit their way through hundreds of vulnerabilities that lurk in business applications today.  Success means learning quickly that attack and defense is all about thinking on your feet. Standard capture the flag using network and operating attack skills will not be much use here; understanding the OWASP Top 10 risks will help you find the vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
For each vulnerability you uncover, you are awarded points. Climb the interactive leaderboard for a chance to win prizes! CMD+CTRL is ideal for development teams to train and develop skills, but anyone involved in keeping your organization’s data secure can play - from developers and managers and even CISOs.&lt;br /&gt;
&lt;br /&gt;
Just bring a laptop. Pizza and soda will be provided.&lt;br /&gt;
&lt;br /&gt;
Venue/Location of the event:&lt;br /&gt;
&lt;br /&gt;
Athena Health&lt;br /&gt;
311 Arsenal St.&lt;br /&gt;
Watertown, MA 02472&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Athenahealth Watertown Map.jpg|Athenahealth Watertown Map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
NOTE:&lt;br /&gt;
&amp;lt;b&amp;gt;Park in only P2 visitor lot or in garages P1 and P3. Parking is free.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main lobby door is at “S1” shuttle pickup icon.&lt;br /&gt;
&lt;br /&gt;
Enter the lobby and sign in at the front desk to pick up credentials.&lt;br /&gt;
&lt;br /&gt;
Directions to the event room will be provided at that time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Training ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Past Meetings ===&lt;br /&gt;
&lt;br /&gt;
 '''January 29th, 2019''' - Cambridge [https://web.securityinnovation.com/owaspboston2019 Partnered with Security Innovation]&lt;br /&gt;
&lt;br /&gt;
Location: [https://goo.gl/maps/w11GUuJJAbo Quick Base office]&lt;br /&gt;
&lt;br /&gt;
5PM- '''Just bring your computer and evil inner-doer and you are ready to roll!'''&lt;br /&gt;
&lt;br /&gt;
Security Innovation is teaming up with OWASP Boston to offer attendees a fun &amp;quot;find the vulnerabilities&amp;quot; game - CMD+CTRL Cyber Range - that shows how hackers break into websites and teaches the importance of secure coding habits.  &lt;br /&gt;
&lt;br /&gt;
The CMD+CTRL Cyber Range we will be using is called ShadowBank, a banking website where players compete to find vulnerabilities, score points, and move up the leaderboard.  Leveraging cheat sheets, attack tables, and expert led training sessions, platers take their shot at stealing money, manipulating share prices, and conducting other nefarious acts.&lt;br /&gt;
  &lt;br /&gt;
 '''June 14th, 2017''' - Burlington [https://www.meetup.com/owaspboston/events/240033562/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
7:00 pm  ''' Is RASP Ready?'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection is overhyped, according to many analysts and pundits. RASP promises applications that protect themselves - which sounds impossible - how can an application possibly protect itself? An agent that sits inside the app sounds like a deployment nightmare at worst, and a drain on the app at best. What’s the reality? Where are we now and what have we learned? &lt;br /&gt;
&lt;br /&gt;
We’ve seen deployment successes and failures, and we will draw from those specific experiences to describe: &lt;br /&gt;
Where does RASP work? &lt;br /&gt;
* What applications are well-suited for RASP? &lt;br /&gt;
* What types (organizational structure, culture, or skillset) of organizations are well-suited for RASP?&lt;br /&gt;
&lt;br /&gt;
What is the reality of RASP? &lt;br /&gt;
* Is RASP a deployment model or a feature set? &lt;br /&gt;
* How mature is RASP? Is it an over-hyped immature space, enterprise-ready, or somewhere in between? &lt;br /&gt;
* Which RASP capabilities do organizations use? And how do they validate those capabilities in their own environments? &lt;br /&gt;
* Can RASP replace the WAF?&lt;br /&gt;
&lt;br /&gt;
We will conclude, not with a sales pitch, but some lessons learned on: the three must have attributes for RASP, some suggestions on good candidates for RASP – both types of teams and types of applications, and finally - if, how, and when to get started. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Michael Feiertag, CEO and Co-Founder, tCell &lt;br /&gt;
Before co-founding tCell at the end of 2014, Michael led a string of successful products – most recently as head of products at Okta, and prior to that, as technology director at Blue Coat. Prior to Blue Coat, Michael held product management, engineering, and sales positions at several start-ups. Michael holds a B.S. from The University of Chicago, and an M.S. from the University of Maryland&lt;br /&gt;
&lt;br /&gt;
 '''May 2, 2017''' - Burlington [https://www.meetup.com/owaspboston/events/239130768/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
6:50 pm  '''Random Number Generation - Lava Lamps, Clouds, New Standards and the IoT - Richard Moulds'''&lt;br /&gt;
&lt;br /&gt;
The SANS Institute recently listed &amp;quot;Weak random number generators&amp;quot; as one of the 7 most dangerous security techniques to watch in 2017. But how do you really know how good your random numbers are? Virtualization and IoT make things worse and new standards are a wake-up call. Random numbers are the basis of security for all cryptography, yet they are often taken for granted. Without entropy, crypto is just math.  &lt;br /&gt;
&lt;br /&gt;
Learn why random numbers are so hard to generate and validate, compare different technologies in use today across virtualized environments, and discuss operational steps to take the risk out of random numbers and help secure cryptosystems even into the era of quantum computers. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Richard Moulds, General Manager of Whitewood Security, has spoken at RSA 2017 and at several OWASP chapter events in New York, Chicago and Austin. Richard has over 20 years of experience in the area of cryptography and encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2, 2016''' - Cambridge [https://www.meetup.com/owaspboston/events/234648485/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 90 Broadway, Cambridge, MA 02142 (down the street from the usual location)&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
7:00 '&amp;lt;nowiki/&amp;gt;''Advanced Persistent Legal Threats''' - '''''&amp;lt;nowiki/&amp;gt;'''William Gamble, JD, LLM, EMBA'''&lt;br /&gt;
&lt;br /&gt;
Abstract: Good cyber security can protect IT infrastructure against many attacks. Because of the difficulty in monetizing cyber thefts, the direct loss of a breach can be limited. However, the legal costs, both from government agencies and plaintiffs, can be far greater. The legal landscape, both in the US and internationally is changing as fast if not faster than the technology.&lt;br /&gt;
&lt;br /&gt;
Bio: I am a lawyer and a member of the Florida Bar.I used to practice tax, securities and banking law. I have written three books and spoken around the world on the economic efficiency of legal and regulatory infrastructures specifically in emerging markets like China. Over the past two years, I have immersed myself in cyber security. I now hold the CompTIA A+, Network+, and Security+. I will take the CASP next month. Besides keeping up with the regulations, I am studying incident response and auditing. I am also working toward my health care law certification. My hero is Dr. Johannes Ullrich.&lt;br /&gt;
&lt;br /&gt;
 '''September 28, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/233921522/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
6:15 '''OWASP Top 10 #1 - Injection Flaws'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss XML External Entity Injection flaws; how it works, how to prevent, code examples.&lt;br /&gt;
&lt;br /&gt;
6:45 '&amp;lt;nowiki/&amp;gt;''From the Frontlines of RASP Adoption''' - '''''&amp;lt;nowiki/&amp;gt;'''Goran Begic, VP of Product, IMMUNIO'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection (RASP) is one of the newest technologies coined by Gartner and it is in early stages of adoption in the industry. It promises dynamic defense and automatic mitigation of vulnerabilities in web applications.&lt;br /&gt;
&lt;br /&gt;
This presentation is a summary of experiences from several dozens of commercial evaluations and early adoptions in production that took place this year and provides some examples of situations and challenges that are not specific to any individual vendor. In this talk Goran will provide an overview of buying criteria and evaluation requirements across different industries and some typical pitfalls that can slow down adoption.&lt;br /&gt;
&lt;br /&gt;
After the introduction and a brief reminder on the technology Goran will invite audience to participate in discussion about organizational requirements for adoption and operationalization of RASP. &lt;br /&gt;
&lt;br /&gt;
Questions for discussion: &lt;br /&gt;
&lt;br /&gt;
My application is under attack. &lt;br /&gt;
*What actions should I take? &lt;br /&gt;
*Who owns the response? &lt;br /&gt;
*Which attacks should I respond to and which ones can I ignore?&lt;br /&gt;
*How to get started with mitigation provided by technology? &lt;br /&gt;
*Does RASP fit with DevOps? &lt;br /&gt;
*Does RASP help with remediation? &lt;br /&gt;
&lt;br /&gt;
What this presentation is not: This is not a product pitch in any way. Evaluation criteria, comparison of RASP with IAST and other security technologies, personal experiences and examples discussed in this talk are generally applicable to all RASP solutions. &lt;br /&gt;
&lt;br /&gt;
Key takeaways:&lt;br /&gt;
&lt;br /&gt;
At the end of the presentation you will: &lt;br /&gt;
*get a better understanding of requirements for evaluation of RASP and its use cases, &lt;br /&gt;
*if you can pull a successful evaluation alone, or if you will need participation of other groups / teams &lt;br /&gt;
*learn about critical criteria for success of RASP in production &lt;br /&gt;
*how this criteria different relative to appsec testing tools.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 7, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Docker Containers and Application Security''' - '''Tsvi Korren'''&lt;br /&gt;
&lt;br /&gt;
Docker containers are transforming the way applications are developed and deployed. Closely tied to DevOps and Continuous Delivery, containers introduce both risks and opportunities to security management in Web applications. This talk will introduce the basic concepts of containers, how companies use them today and how to support this technology while elevating the security posture of your application stacks.&lt;br /&gt;
&lt;br /&gt;
Tsvi Korren, CISSP, has been an enterprise IT professional for 20 years with background in business process consulting in large organizations. Most recently at CA Technologies, he worked across verticals in government, retail, financial institutions and healthcare to implement compliance and security processes, from Identity and Access to Host and Server Controls. Tsvi is currently the director of technical services at Aqua, concentrating on building bridges between DevOps and Security.&lt;br /&gt;
&lt;br /&gt;
 '''June 8, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/230842887/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6-6:30 '''News, announcements, job postings, etc. '''&lt;br /&gt;
&lt;br /&gt;
6:30-7 '''Introduction to SQL Injection - Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Computer Science Curricula’s Failure - What Should We Do Now?''' - '''Ming Chow &amp;amp; Roy Wattanasin'''&lt;br /&gt;
&lt;br /&gt;
We are still facing the same security vulnerabilities from over a decade ago. The problems are not going away anytime soon and a reason is because Computer Science curricula are still churning out students who are not even exposed to security. This talk will address the lack of emphasis on information security in Computer Science curricula, how CS curricula have an obligation, how to gradually fix the problem by integrating security into many Computer Science undergraduate and graduate classes, and success stories from students. This talk will also discuss what Tufts and Brandeis are currently working on to further address the security education problem by creating a joint cyber security and policy program that spans multiple departments. Additional points and feedback from the audience are encouraged to help with the issue. All are encourage to attend to submit your feedback to help!&lt;br /&gt;
&lt;br /&gt;
Presenters: &lt;br /&gt;
&lt;br /&gt;
Ming Chow - @0xmchow &lt;br /&gt;
&lt;br /&gt;
Ming Chow is a Senior Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He was a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World, DEF CON, Intel, SOURCE Conference, and BSides Boston. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2014 and 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin - @wr0 &lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin is an adjunct faculty at Brandeis University in both the Health and Medical Informatics and Information Security graduate programs. He spends most of his time leading, teaching and developing information security programs, finding vulnerabilities, performing incident response and working on many projects. Roy has spoken at many conferences including RSA, ISSA International, Source Conference, Braintank, Cyber Security World, OWASP and the Security BSides conferences. He is also a healthcare information security professional. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2015. &lt;br /&gt;
&lt;br /&gt;
 '''May 4, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229788205/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Slightly different [http://www.akamai.com/html/about/locations.html Akamai] location: 90 Broadway, Cambridge, MA 02142 between Meadhall and the Mariott&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZAP''' - '''Dan Cornell'''&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons to use source code to assist in web application penetration testing such as making better use of penetration testers’ time, providing penetration testers with deeper insight into system behavior, and highlighting specific sections of so development teams can remediate vulnerabilities faster. Examples of these are provided using the open source ThreadFix plugin for the OWASP ZAP proxy and dynamic application security testing tool. These show opportunities attendees have to enhance their own penetration tests given access to source code.&lt;br /&gt;
&lt;br /&gt;
This presentation covers the “ABCs” of source code assisted web application penetration testing: covering issues of attack surface enumeration, backdoor identification, and configuration issue discovery. Having access to the source lets an attacker enumerate all of the URLs and parameters an application exposes – essentially its attack surface. Knowing these allows pen testers greater application coverage during testing. In addition, access to source code can help to identify potential backdoors that have been intentionally added to the system. Comparing the results of blind spidering to a full attack surface model can identify items of interest such as hidden admin consoles or secret backdoor parameters. Finally, the presentation examines how access to source code can help identify configuration settings that may have an adverse impact on the security of the deployed application.&lt;br /&gt;
&lt;br /&gt;
Dan Cornell is a globally recognized application security expert, Dan Cornell holds over 15 years of experience architecting, developing and securing web-based software systems. As the Chief Technology Officer and a Principal at Denim Group, Ltd., he leads the technology team to help Fortune 500 companies and government organizations integrate security throughout the development process. He is also the original creator of ThreadFix, Denim Group's industry leading application security program management platform. Cornell was Principal Investigator as Denim Group researched and developed the Hybrid Analysis Mapping (HAM) technology that lies at the heart of ThreadFix, through a Small Business Innovation Research (SBIR) contract with the Department of Homeland Security's Science and Technology Directorate.&lt;br /&gt;
&lt;br /&gt;
More information at: http://www.denimgroup.com/about_team_dan.html&lt;br /&gt;
&lt;br /&gt;
 '''April 6, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Runtime Application Self-Protection (RASP) Tools''' - '''Kunal Anand'''&lt;br /&gt;
&lt;br /&gt;
This talk will highlight the latest in AppSec and dive into a different kind of solution called Runtime Application Self-Protection (RASP). We'll also explore a new methodology called language theoretic security (LANGSEC) and explain how it can outperform existing approaches like pattern matching, regular expressions, etc. This talk will lay the foundation via informal and formal theory how lexers, tokenizers and parsers work. We’ll move onto constructing an open source toolchain to analyzing data and exploring interactive data visualizations. Along the way, we’ll cover performance tradeoffs and discuss the challenges of modern application security.&lt;br /&gt;
&lt;br /&gt;
Kunal Anand is the co-founder and CTO of Prevoty, a runtime application security platform. Prior to that, he was the Director of Technology at the BBC Worldwide, overseeing engineering and operations across the company’s global Digital Entertainment and Gaming initiatives. Kunal also has several years of experience leading security, data and engineering at Gravity, MySpace and NASA’s JetPropulsion Laboratory. His work has been featured in Wired Magazine and Fast Company. Kunal received a B.S. from Babson College.&lt;br /&gt;
&lt;br /&gt;
=== Past Training ===&lt;br /&gt;
&lt;br /&gt;
 '''March 16, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/229156529/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Demandware, Burlington.&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
6:30 '''Software Security by the Numbers''' - '''Chris Eng'''&lt;br /&gt;
&lt;br /&gt;
Deep dive into data we’ve collected about the state of software security in 2016 &lt;br /&gt;
* Based on scans of 200,000+ applications over an 18-month period &lt;br /&gt;
* How different industries and programming languages compare to one another &lt;br /&gt;
* Vulnerability remediation habits and patterns &lt;br /&gt;
* Three characteristics of a successful AppSec program &lt;br /&gt;
&lt;br /&gt;
Chris Eng is vice president of research at Veracode. In this role, he leads the team responsible for integrating security expertise into all aspects of Veracode’s technology. Throughout his career, he has led projects breaking, building, and defending web applications and commercial software for some of the world’s largest companies. Chris is a frequent speaker at premier industry conferences, where he has presented on a diverse range of topics, including cryptographic attacks, agile security, mobile application security, and security metrics. He has been interviewed by Bloomberg, Fox Business, CBS, and other media outlets worldwide.&lt;br /&gt;
&lt;br /&gt;
 '''January 26, 2016''' - Waltham - [http://www.meetup.com/owaspboston/events/228202040/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Waltham.  Trapelo Rd. exit from Rt. 128, toward Lincoln. The parking lot entrance is on the right, at the first traffic light. Drive around to the front of the office complex, facing the highway. Enter under the clock tower. Park in the front of the building and enter in the main building lobby, continue down the hallway and you will see the innovation center, enter in the large glass doors. &lt;br /&gt;
&lt;br /&gt;
7:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:20 '''What Security Testing Tools Miss'''&lt;br /&gt;
&lt;br /&gt;
Black Duck Software presents - Static analysis, dynamic analysis, and other testing tools are all essential weapons against adversaries.  But for the 80%+ of companies worldwide that use open source software in their application development these tools are ineffective in identifying and mitigating open source security risks . This presentation will cover:&lt;br /&gt;
&lt;br /&gt;
The value of static and dynamic tools, and where they best fit in the Secure Development Lifecycle          &lt;br /&gt;
&lt;br /&gt;
Why these tools are not useful in identifying known vulnerabilities in open source components          &lt;br /&gt;
&lt;br /&gt;
Controls development and security professionals can deploy to select, detect, manage and monitor open source for existing and newly disclosed vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Food will be provided by Constant Contact.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2015''' - Cambridge - [http://www.meetup.com/owaspboston/events/226394218/ Meetup]&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
Attendee interaction is always mentioned as a high value at meetings and was great at the MetroWest meetings, so we're doing that at Akamai this month. Some discussion starters so far: SSL certificate impacts from CA/Browser alliance decisions and SHA1 weakness; mutual (client) SSL, javascript client and server side; what the heck is threat intelligence, dev ops and faster secure SDLC.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Metrowest&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 20, 7:00 pm&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Innovation Center, Reservoir Place, 1601 Trapelo Road, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
7:00 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:30 '''Access in Maliceland - Risk Based Access Control''' - '''Gunnar Peterson'''&lt;br /&gt;
&lt;br /&gt;
John Lambert observed attackers win because while defenders think in lists, attackers think in graphs. Access control systems divide the system a priori into secure and insecure states. But that’s only worth the paper its printed on. A  Attackers see the system as it is, for attackers, the access control scheme is the beginning of the game not the end. Determined attackers seek out access control models and then find holes that they can leverage. Access control systems that purport to protect the system are built on assumptions from which reality diverges. Application security needs a new approach to access control- adding feedback loops for risk based decisions,  fine-grained, dynamic access control. &lt;br /&gt;
&lt;br /&gt;
Security is a business with a very long list of issues and requirements. The spreadsheets are miles long. This makes it essential to find reusable solution patterns that can address multiple problems.This presentation looks at both medium term improvements and code examples to improve access control decisions and overall security today&lt;br /&gt;
&lt;br /&gt;
Gunnar Peterson ([https://twitter.com/oneraindrop @oneraindrop]) focuses on security architecture consulting and training. Experience includes Associate Editor for IEEE Security &amp;amp; Privacy Journal, a Microsoft MVP for App security, an IANS Research Faculty member, a Securosis Contributing Analyst, and a Visiting Scientist at Carnegie Mellon Software Engineering Institute. He maintains a popular information security blog at http://1raindrop.typepad.com.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Cambridge&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 8, 6:30 pm  ''NOTE: It's the second Wednesday this month.''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
 '''June 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Put Down the Megaphone: Effective Security Advocacy Without the Shouting''' - '''Darren Meyer'''&lt;br /&gt;
&lt;br /&gt;
10 years’ experience in the InfoSec community--including work with organizations in many verticals, in sizes ranging from startups to Fortune 50 enterprises, leading Application Security teams, building and delivering security instruction to developers, managers, and InfoSec professionals—has taught me the importance of crafting advocacy for different audiences. In this talk, I share my experiences in learning to be an effective advocate with three key audiences: developers, management, and non-technical staff.&lt;br /&gt;
&lt;br /&gt;
Darren is an Application Security advocate and researcher, technology hobbyist, and maker. He loves to learn, teach, nerd out, and inflict terrible puns on people. His background includes logistics, software development, and an assortment of information security roles including leading AppSec programs and professional security instruction targeting developers, managers, and InfoSec professionals.&lt;br /&gt;
&lt;br /&gt;
 '''May 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How the crowd is discovering critical vulns missed by traditional methods''' - '''Leif Dreizler'''&lt;br /&gt;
&lt;br /&gt;
State of the art security programs are turning to bug bounties to leverage a vast array of skill-sets and knowledge. Learn why these programs work, when to deploy them, and how you can bring these new application security testing capabilities into your own organization. The speaker will discuss real world examples from bug bounties and focus on cases where business logic flaws and high priority vulnerabilities were found ... even with existing security testing processes in place. &lt;br /&gt;
&lt;br /&gt;
Attendees will learn:&lt;br /&gt;
&lt;br /&gt;
Testing methods deployed by our crowd that help them find bugs the scanners miss&lt;br /&gt;
&lt;br /&gt;
Examples of the high quality of bugs our crowd is finding, including P1'sTrends which vulnerability types are found most often and whyWhat is the ROI on the pay for performance modelWhere does the SDLC merge into crowdsourced testing&lt;br /&gt;
&lt;br /&gt;
Leif Dreizler is a Senior Security Engineer at Bugcrowd, the innovator in crowdsourced security testing for the enterprise. Prior to joining Bugcrowd, Leif was a Senior Application Security Engineer at Redspin, performing application security assessments. During his time at Redspin he also served as the Application Team Lead, liaising with clients at the engineering and sales level. He has also made minor contributions to the Firebug project. Leif attended the University of California, Santa Barbara where he studied Computer Science. Leif recently spoke to the NYC Security Meet-up group.&lt;br /&gt;
&lt;br /&gt;
 '''April 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler Will show some actual examples and patterns of SQL Injection attempts&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Are You An Imposter? Me too!''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
Many people in the information security field feel like a fraud, or an imposter. In reality, we often know far more, and are capable of far more than we believe we do. There is so much to know and we constantly hear about the latest groundbreaking research done by others, which makes us feel less important or worthy. Let’s talk about what Imposter Syndrome is, its prevalence, and then we can start to realize just how capable we are and go forward with the confidence in the field.&lt;br /&gt;
&lt;br /&gt;
 '''March 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, March 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Prioritizing Web Application Vulnerabilities – A Hacker’s Perspective''' - '''Nick Silver'''&lt;br /&gt;
&lt;br /&gt;
The best application risk models capture not only the technical risk factors, but also the business context in which an asset lives.  Traditionally, this is done by auditing application owners on an array of questions in order to properly classify the asset and its data – but that takes time which could be better spent elsewhere.  We interviewed dozens of hackers and asked them which vulnerabilities they would look for first depending on the type of attack they wanted to carry out.  We’ll walk through several examples of how to use this data as a shortcut means for prioritizing risk without the need for any pesky audit questionnaires.&lt;br /&gt;
&lt;br /&gt;
Nick Silver is a Senior Solutions Architect with WhiteHat Security.  He is responsible for translating business requirements into technical ones and assisting businesses in implementing web security programs.  Previously, Nick led a team in WhiteHat’s Threat Research Center where they were responsible for testing more than 2,000 of their customers’ websites for vulnerabilities.  &lt;br /&gt;
&lt;br /&gt;
 '''February 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, announcements''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Incident Response and Web Application Security - Stories from the Trenches''' - '''Fred House and Joe Ceirante'''&lt;br /&gt;
&lt;br /&gt;
Mandiant has conducted numerous incident response engagements throughout its history, including a record number of 200 incidents in 2014. Mandiant consultants Fred House and Joe Ceirante will discuss case studies and trends Mandiant has observed in relation to web application security.&lt;br /&gt;
 &lt;br /&gt;
Topics will include the types of threat actors that target web applications, the techniques they use to compromise web applications, and the activities they perform once inside the network. Techniques for detecting and mitigating web compromises will also be reviewed. All content will be derived from the real-world compromises that Mandiant has investigated.&lt;br /&gt;
&lt;br /&gt;
 '''January 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 7, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, risk analysis of Poodle''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How a Hacker Views Your Web Site''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
''The most popular presentation of BASC 2014''&lt;br /&gt;
&lt;br /&gt;
As defenders, we have to be right 100% of the time where an attacker only needs to be right once. The attack surface of a modern web site is incredibly large and we need to be aware of all of it. Additionally, individual attacks may not always be effective but sometimes using them together can gain the desired effect. In this talk, we’ll take a look at the whole attack surface for a typical web site and the various ways that an attacker will use to compromise a site.&lt;br /&gt;
&lt;br /&gt;
 '''December 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, December 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News and Views You Can Use and Abuse''' - '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
* Some thoughts and analysis on some current app security news and other stuff&lt;br /&gt;
* Adobe password breach&lt;br /&gt;
* Reducing Web Application Firewall SQL injection false positives&lt;br /&gt;
 &lt;br /&gt;
7:15 '''Swift and Security''' - '''Ming Chow'''&lt;br /&gt;
 &lt;br /&gt;
Apple is pushing its new programming language Swift for iOS development and for many good reasons.  This talk will discuss what the language has right in terms of security, the old and new security pitfalls, and what developers need to be aware of moving forward with using the new language.  The fact to the matter is, iOS isn't going away, iOS developers will need to learn and use Swift, and there will be a big rush of Swift-based apps: we might as well learn how to do it right the first time around.&lt;br /&gt;
 &lt;br /&gt;
Ming Chow is an Instructor at the Department of Computer Science, Tufts University. Ten years of web development experience.&lt;br /&gt;
Specialties: Web and Mobile Development, Web and Mobile Security&lt;br /&gt;
&lt;br /&gt;
 '''July 2014'''&lt;br /&gt;
&lt;br /&gt;
Topics: '''Grails Security''' and '''Validating Cross-Site Scripting Vulns with xssValidator'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Cyrus Malekpour''' and '''John Poulin'''&lt;br /&gt;
&lt;br /&gt;
When: Tuesday, July 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic 1: ''Grails Security''&lt;br /&gt;
&lt;br /&gt;
Grails is a framework developed for Groovy in the vein of Rails for Ruby. It provides a lot of features for web app security, but does it do enough? What might you need to implement yourself, and what might be provided? This presentation will discuss tips on securing Grails applications, including tools that the framework provides by default for security. It'll also discuss several shortcomings in the current toolset, and how you can avoid them.&lt;br /&gt;
 &lt;br /&gt;
Cyrus Malekpour (@cmalekpour) is currently interning at nVisium, working on web app development and security. He's currently an undergraduate student at the University of Virginia, where he's studying computer science with an emphasis on security and backend development. &lt;br /&gt;
 &lt;br /&gt;
Topic 2: ''Validating Cross-Site Scripting Vulns with xssValidator''&lt;br /&gt;
 &lt;br /&gt;
xssValidator is a tool developed to automate the testing and validation of Cross-Site Scripting (xss) vulnerabilities within web applications. Automated scanners tend to report large amounts of false-positives, and as consultants we're forced spending our time trying to verify these findings. xssValidator leverages scriptable web-browsers such as PhantomJS and Slimer.js to automatically validate these findings.&lt;br /&gt;
 &lt;br /&gt;
John Poulin is an application security consultant for nVisium who specializes in web application security. He worked previously as a web developer and software engineer that focused on building multi-tier web applications. When he's not hacking on web apps, John spends his time building tools to help him hack on web apps! You can find him on twitter: @forced_request and on myspace: REDACTED.&lt;br /&gt;
&lt;br /&gt;
 '''June 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection and the OWASP Zed Attack Proxy (ZAP)'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Rob Cheyne and Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 - general networking, news discussion, announcements.&lt;br /&gt;
&lt;br /&gt;
7:00 - main presentations&lt;br /&gt;
&lt;br /&gt;
The June 4th meeting will be the second in our series of 2014 training meetings. Rob Cheyne will continue explaining and exploring SQL Injection by conducting an actual injection attack.&lt;br /&gt;
&lt;br /&gt;
This will be a demo-based discussion to get into the mindset of an attacker, and show how an attacker goes after a site. Demo will include: &lt;br /&gt;
&lt;br /&gt;
* BurpProxy demo &lt;br /&gt;
* Common authentication flaws &lt;br /&gt;
* SQL Injection Demo that shows the process and how it builds to a full compromise&lt;br /&gt;
&lt;br /&gt;
'''Rob Cheyne''' is currently CEO of Big Brain Security. In addition to security consulting for Fortune 500 customers, he was the author of LC4, a version of the award-winning L0phtCrack password auditing tool, and he also worked on the code scanning technology that was eventually spun off as Veracode. Rob was at @stake from the very first customer all the way through to the $50M acquisition by Symantec.&lt;br /&gt;
&lt;br /&gt;
'''Jim Weiler''' will introduce the OWASP Zed Attack Proxy (ZAP). This is a very powerful free OWASP intercepting proxy that lets you see, analyze, change, replay etc. every browser request and response, analyze your session, scan and attack web sites, save the results and run reports. We can't cover all the functionality but we'll show some practical tips and techniques.&lt;br /&gt;
&lt;br /&gt;
Pizza, salad and soda courtesy of Akamai&lt;br /&gt;
&lt;br /&gt;
 '''March 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection, WebGoat, Cross Site Request Forgery'''&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
When: Wednesday, March 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
There will be three training sessions:&lt;br /&gt;
&lt;br /&gt;
One will be on SQL Injection - intro, detection, prevention, scanning and false positives. This is the most serious web application vulnerability.&lt;br /&gt;
&lt;br /&gt;
The second will be on OWASP WebGoat. WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons. You can install and practice with WebGoat in either J2EE or in ASP.NET. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat applications. There are hints and 39 different lesson plans on various vulnerabilities and technologies. We won't cover all of them of course!&lt;br /&gt;
&lt;br /&gt;
The third will be on Cross Site Request Forgery - not a hack really, it's just the way the web works. But it causes apps to do legitimate things that you didn't ask them to do.&lt;br /&gt;
&lt;br /&gt;
Pizza and drinks provided by Akamai.&lt;br /&gt;
&lt;br /&gt;
 '''January 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''JavaScript Verification: From Browsers to Pages'''&lt;br /&gt;
&lt;br /&gt;
Modern web browsers implement a &amp;quot;private browsing&amp;quot; mode that is intended to leave behind no traces of a user's browsing activity on their computer. This feature is in direct tension with support for *extensions*, which let users add third-party functionality into their browser. I will discuss the scope of this problem, present our approach to verifying extensions' compliance with private browsing mode, and sketch our findings on several real, third-party extensions. I will then briefly describe the toolkit underlying our approach, and end with a sketch of a newer project, adapting this approach to the very different-seeming problem of statically catching errors when using the jQuery library.&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
&lt;br /&gt;
Benjamin Lerner has just completed a post-doctoral research position in the PLT group at Brown University, and is now a lecturer at Northeastern University.  His research examines the challenges of analyzing client-side web programming, from the behavior of web pages down through the semantics of the browser.  He received a PhD in Computer Science from the University of Washington in 2011, building a platform to analyze conflicts between browser extensions, and a B.S. in Computer Science and Mathematics from Yale University.&lt;br /&gt;
&lt;br /&gt;
 '''November 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Attacking iOS Applications'''  &lt;br /&gt;
&lt;br /&gt;
Slides: [http://www.slideshare.net/kfosaaen/i-os-gcandpb On slideshare]&lt;br /&gt;
&lt;br /&gt;
This presentation will cover the basics of attacking iOS applications (and their back ends) using a web proxy to intercept, modify, and repeat HTTP/HTTPS requests. (The proxy used during research was Burp; however, any HTTP intercepting proxy such as OWASP ZAP could be used) From setting up the proxy to pulling data from the backend systems, this talk will be a great primer for anyone interested in testing iOS applications at the HTTP protocol level. There will be a short (2 minute) primer on setting up the intercepting proxy, followed by three practical examples showing how to intercept data headed to the phone, how to modify data heading to the application server, and how to pull extra data from application servers to further an attack. All of these examples will focus on native iOS apps (Game Center and Passbook) and/or functionality (Passbook Passes).&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Karl Fosaaen'''&lt;br /&gt;
&lt;br /&gt;
Karl is a senior security consultant at NetSPI. This role has allowed Karl to work in a variety of industries, including financial services, health care, and hardware manufacturing. Karl specializes in network and web application penetration testing. In his spare time, Karl helps out as an OPER at THOTCON and a swag goon at DEF CON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''October 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, October 2, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Abusing NoSQL Databases'''&lt;br /&gt;
&lt;br /&gt;
The days of selecting from a few SQL database options for an application are over. There is now a plethora of NoSQL database options to choose from: some are better than others for certain jobs. There are good reasons why developers are choosing them over traditional SQL databases including performance, scalabiltiy, and ease-of-use. Unfortunately like for many hot techologies, security is largely an afterthought in NoSQL databases. This short but concise presentation will illustrate how poor the quality of security in many NoSQL database systems is. This presentation will not be confined to one particular NoSQL database system. Two sets of security issues will be discussed: those that affect all NoSQL database systems such as defaults, authentication, encryption; and those that affect specific NoSQL database systems such as MongoDB and CouchDB. The ideas that we now have a complicated heterogeneous problem and that defense-in-depth is even more necessary will be stressed. There is a common misconception that SQL injection attacks are eliminated by using a NoSQL database system. While specifically SQL injection is largely eliminated, injection attack vectors have increased thanks to JavaScript and the flexibility of NoSQL databases. This presentation will present and demo new classes of injection attacks. Attendees should be familiar with JavaScript and JSON. &lt;br /&gt;
&lt;br /&gt;
Presenter: '''Ming Chow'''&lt;br /&gt;
&lt;br /&gt;
Ming Chow (@tufts_cs_mchow) is a Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He teaches courses largely in the undergraduate curriculum including the second course in the major sequence, Web Programming, Music Apps on the iPad, and Introduction to Computer Security. He was also a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World (2011 and 2012), DEF CON 19 (2011), the Design Automation Conference (2011), Intel, and the SOURCE Conference (Boston 2013). Ming's projects in information security include building numerous CTF challenges, Internet investigations, HTML5 and JavaScript security, and Android forensics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 2013 - Joint Meeting with [http://www.meetup.com/Boston-cloud-services/ Boston Cloud Services]''' &lt;br /&gt;
&lt;br /&gt;
When: Tuesday, September 10, 6 pm&lt;br /&gt;
&lt;br /&gt;
Location: Microsoft NERD Center ''(not our usual location)''&lt;br /&gt;
&lt;br /&gt;
'''Note: This is a joint meeting. Please register at [http://www.meetup.com/Boston-cloud-services/ the Boston Cloud Services meetup page] if you plan to attend.'''&lt;br /&gt;
&lt;br /&gt;
There will be two presentations at this meeting:&lt;br /&gt;
&lt;br /&gt;
Topic: '''People Centric Security (PCS)'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Nick Stamos'''&lt;br /&gt;
&lt;br /&gt;
People Centric Security (PCS) is a new security model, presented as part of Gartner's Maverick Research 2 year ago. PCS is well suited for Cloud Business/Consumer services such as Dropbox, Google Drive, SkyDrive, etc. PCS enables users to have what they desire, and provides enterprises what they require for data governance and compliance. Nick Stamos co-founded his fourth company, nCrypted Cloud in July of 2012. His past startups include Verdasys, Phase Forward (IPO FY2004, $685M Oracle Acquisition 2010), and Amulet. He studied at Tufts University where he received a BSEE and MSEE.&lt;br /&gt;
&lt;br /&gt;
Topic: '''SSL Certs'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
Practical experiences with issuing and risk assessing SSL certs for enterprise applications on a cloud provider: who creates the CSR, how do you protect the private key on the cloud server, certs on cloud provider managed load balancers vrs 3rd party managed app servers, roles and responsibilities of cloud IT, 3rd party developer IT, enterprise IT and service providers. Jim Weiler is Application Security Architect at Starwoods Hotels and the Chapter Leader of OWASP Boston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July 2013 - Doubleheader!'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 10, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Topic: '''RailsGoat'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Ken Johnson'''&lt;br /&gt;
&lt;br /&gt;
Abstract: While working to secure rails applications in a truly Agile development environment, it became clear that the Rails and Ruby ecosystem needed attention from the security community in the form of free and open training, and the events that have transpired within the last few months have only reinforced that belief. [http://railsgoat.cktricky.com/ RailsGoat] is an attempt to bring attention to both the problems that most frequently occur in Rails as well as the solutions for remediation. To accomplish this, we've built a vulnerable Rails application that aligns with the OWASP Top 10 and can be used as a training tool for Rails-based development shops.&lt;br /&gt;
&lt;br /&gt;
Topic: '''PhoneGap on Android'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Jack Mannino'''&lt;br /&gt;
&lt;br /&gt;
Abstract: PhoneGap is a widely used framework that allows developers to rapidly build cross-platform mobile applications using HTML5, JavaScript, and CSS. Using PhoneGap plugins, developers can call native platform APIs from browser-like applications using JavaScript. This approach introduces vulnerabilities that are not typically as prevalent within native Android applications, warranting a fresh look at the way we view mobile applications. In this presentation, we will take a deep look at the Android implementation of the framework and we will examine the overall attack surface for applications. Real-world examples of vulnerable applications will be demonstrated as well in order to provide context, entertainment, and enjoyment.&lt;br /&gt;
&lt;br /&gt;
About the Speakers:&lt;br /&gt;
&lt;br /&gt;
Ken Johnson is the former Manager of LivingSocial.com's application security team where he built their security program before leaving for his true home as the CTO of nVisium Security, a VA-based application security company. Ken is the primary developer of the Web Exploitation Framework and contributes to other open source application security projects as often as time permits. He has spoken at AppSec DC 2010 and 2012, OWASP NoVA and Phoenix chapters, Northern Virginia Hackers Association (NoVAH) and is a contributor to the Attack Research team.&lt;br /&gt;
&lt;br /&gt;
Jack Mannino is the CEO of nVisium Security, a VA-based application security company. At nVisium, he helps to ensure that large corporations, government agencies, and software startups have the tools they need to build and maintain successful security initiatives. He is an active Android security researcher/tinkerer, and has a keen interest in identifying security issues and trends on a large scale. Jack is a leader and founder of the OWASP Mobile Security Project. He is the lead developer for the OWASP GoatDroid project, and is the chairman of the OWASP Northern Virginia chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''June 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''We see the future…and it isn’t pretty'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Andrea Mulligan, Sr. Director at Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
In this session Andrea presents research findings from the State of Software Security Report, which offers a before the breach look at security by examining the flaws commonly found in applications of all kinds. She will also examine what the research findings mean for security, predict how these flaws could cause history to repeat itself, and discuss how security pros can help change the future. &lt;br /&gt;
&lt;br /&gt;
 '''May 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Systems Thinking + Web Security'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Akamai'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Akamai will present on ‘Systems Thinking + Web Security’. There will also be an audience review exercise facilitated by the Akamai presenters.  This is a great chance to hear some interesting perspectives on web security from Akamai, who handles about one third of all internet traffic.&lt;br /&gt;
&lt;br /&gt;
 '''April 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Go Fast. Be Secure: Effectively Govern the Use of Open Source Components Throughout the SDLC'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Sonotype'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
* Open Source Software (OSS) Component supply chain complexities and realities. Open source is constantly changing and knowing the version in your software, as well as the current version history of the component (how do you show an auditor you are using a current version) is important. &lt;br /&gt;
* Open Source Consumption Patterns from the Central Repository. Which versions are the most popular can tell you which versions are the most stable, useful, secure etc.&lt;br /&gt;
* OWASP Top 10 (A9) - Using Components with Known Vulnerabilities. To decide on the risk of OSS components with vulnerabilities, you need to know the vulnerabilities, their severity and which components they occur in as well as where in the code dependency tree they are. &lt;br /&gt;
* OSS Security, Quality and License policies must be woven into the development process. Knowing the number and type of open source licenses in your software can be important to the legal standing of your code and if it conflicts with any corporate standards. The licensing is also important in order to know the restrictions on changing the software.&lt;br /&gt;
* OSS Component Policy Examples&lt;br /&gt;
* Example Application Compositions Reports&lt;br /&gt;
* Example Use cases IDE, CI, repository, production applications&lt;br /&gt;
* Discussion&lt;br /&gt;
&lt;br /&gt;
About Sonatype:&lt;br /&gt;
&lt;br /&gt;
Sonatype operates the Central Repository, the industry's primary source for open-source components, housing more than 400,000 components and serving more than five billion requests per year from more than 60,000 organizations. The company has been a pioneer in component-based software development since its founding by Jason van Zyl, the creator of the Apache Maven build management system and the Central Repository. &lt;br /&gt;
&lt;br /&gt;
 '''March 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''What is BSIMM?'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Nabil Hannan'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Nabil is Director of Vulnerability Assessments and Managing Consultant at Cigital.&lt;br /&gt;
 &lt;br /&gt;
The purpose of the BSIMM is to quantify the activities carried out by real software security initiatives. BSIMM is a study of the secure development practices of over 50 organizations, analyzed along the dimensions that were found in the data, not along preconceived ideas of what secure development should be.  &lt;br /&gt;
&lt;br /&gt;
BSIMM describes the work of 974 software security group members working with a satellite of 2039 people to secure the software developed by 218,286 developers. &lt;br /&gt;
&lt;br /&gt;
The BSIMM describes 111 activities that any organization can put into practice. The activities are described in twelve practices grouped into four domains. Associated with each activity is an objective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''February 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''BroBot'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Eric Kobrin, Akamai'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Eric Kobrin is a Senior Security Architect in the Infosec organization of Akamai Technologies, the global leader in Cloud-based application acceleration and content delivery. Eric has been involved in Software Architecture for over 15 years, having worked at such companies and IBM, Velocitude and eDiets.com. He has a passion for programming languages, security, and software performance and has worked in all layers of the software stack from hypervisors to complex servers and web applications. Eric's works have been published, presented at international conferences and patented.&lt;br /&gt;
 &lt;br /&gt;
His presentation will provide an analysis of the BroBot DDOS attacks, including discussion of:&lt;br /&gt;
&lt;br /&gt;
* Vulnerable system discovery&lt;br /&gt;
* Zombie compromise&lt;br /&gt;
* Control structure&lt;br /&gt;
* Attack traffic&lt;br /&gt;
* Mitigation steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''January 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Third-Party Application Analysis: Best Practices and Lessons Learned'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Chad Holmes, Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Chad Holmes will present details of the work Veracode has been doing with their 3rd Party program, discuss the technical and business challenges that have arisen during that time and lead a discussion on what team members can do to help drive adoption of security best practices across their vendor community.&lt;br /&gt;
&lt;br /&gt;
The flow of the presentation is designed to drive discussion within an audience – both from a technical and business perspective with some anecdotal stories. Chad wants this to be an interactive discussion so he’ll have questions and you should bring yours I’ve already sent him some.  The order of the presentation is:&lt;br /&gt;
&lt;br /&gt;
·         Adoption rates of externally developed software&lt;br /&gt;
&lt;br /&gt;
·         The risk within those apps&lt;br /&gt;
&lt;br /&gt;
·         Some deeper stats on what “3rd party” really means (total outsourcing/total COTS produced/open source/imported libraries/etc)&lt;br /&gt;
&lt;br /&gt;
·         Some raw data about our experiences (to show this is based on a large sample size rather than “Look how awesome Veracode is!”)&lt;br /&gt;
&lt;br /&gt;
·         Challenges that will be faced (business, intellectual property, policy, analysis capabilities, etc)&lt;br /&gt;
&lt;br /&gt;
·         Best Practices for high rates of adoption&lt;br /&gt;
&lt;br /&gt;
·         Lessons Learned and Recommendations&lt;br /&gt;
&lt;br /&gt;
Chad Holmes has over 10 years of software development and application security experience. During his time at Veracode, Chad has lead the redesign and execution of the third-party analysis process to allow for a more streamlined approach while still addressing common ISV intellectual property concerns. In addition to his third-party analysis responsibilities, Chad's previous work as a Security Program Manager has lead to the successful roll out and improvement of multiple corporate application security groups.&lt;br /&gt;
&lt;br /&gt;
 '''June 2012'''&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker '''Will Vandevanter - Rapid 7'''&lt;br /&gt;
&lt;br /&gt;
'''Fingerprinting web applications of all kinds'''&lt;br /&gt;
&lt;br /&gt;
This turbo talk will introduce a new Metasploit module that fingerprints &amp;quot;known&amp;quot; web applications, attempts the default credentials for the application, and runs an associated exploit or authenticated access module if applicable. Some example fingerprints in the database target common enterprise web applications including Microsoft products (Outlook Web Access, Sharepoint), printers (Xerox Document Centre), security cameras, routers, and others. &lt;br /&gt;
&lt;br /&gt;
Will Vandevanter is a senior penetration tester and researcher at Rapid7. His focus interests include web application security and secure code. He has previously spoken at Defcon, SOURCE, BSides LV, and other conferences. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 '''May 31 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Jobspring, Boston. 545 Boylston st. &lt;br /&gt;
&lt;br /&gt;
Speaker - '''Glenn Gramling, Vice President, Cenzic'''&lt;br /&gt;
&lt;br /&gt;
“Cloudy with a Chance of Hack”&lt;br /&gt;
&lt;br /&gt;
Cloud computing is a cost effective and efficient way for enterprises to automate their processes. However organizations need to be aware of the pitfalls of the many cloud solutions out there - one of the main being security. Most cloud applications were built for ease of use and without security necessarily in mind. Companies need to be asking their solution providers about the security measures used in developing the application and get an independent verification to make sure there are no gaping holes. With over 75% of attacks occurring through the Web, any attack through these applications can lead to leakage of confidential information and embarrassment. In this session, we'll give attendees tips and tricks to prepare them for the potential of &amp;quot;stormy weather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Glenn Gramling is responsible for global sales and business development for Cenzic’s  application security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''April 11, 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker - '''David Eoff, Senior Product Marketing Manager, HP Enterprise Security'''&lt;br /&gt;
&lt;br /&gt;
David is a Senior Product Marketing Manager, within the Enterprise Security Products division of HP focused on Fortify application security. His 18+ years of background in software and hardware enterprise marketing provides a solid foundation for his marketing of the HP security solutions. &lt;br /&gt;
 &lt;br /&gt;
Prior to joining Fortify in 2009 and being acquired by HP, David ran Firewall and IPS marketing for the Security division of Nokia Corporation. In addition, he has held multiple positions in product marketing, product management, channel marketing and sales while working for Oracle, EMC, Legato, BMC Software and several start-ups.&lt;br /&gt;
&lt;br /&gt;
Topic - '''Gray, the New Black:  Gray-Box Vulnerability Testing'''&lt;br /&gt;
&lt;br /&gt;
Over the years, two key techniques have emerged as the most effective for finding security vulnerabilities in software:  Dynamic Application Security Testing (DAST) and Static Application Security Testing (SAST).  While DAST and SAST each possess unique strengths, the “Holy Grail” of security testing is thought to be “hybrid” – a technique that combines and correlates the results from both testing methods, maximizing the advantages of each. Until recently, however, a critical element has been missing from first generation hybrid solutions:  information about the inner workings and behavior of applications undergoing DAST and SAST analysis.&lt;br /&gt;
 &lt;br /&gt;
This presentation will introduce you to the next generation of hybrid security analysis – what it is, how it works, and the benefits it offers.  It will also address (and dispel) the claims against hybrid, and leave you with a clear understanding of how the new generation of hybrid will enable organizations to resolve their most critical software security issues faster and more cost-effectively than any other available analysis technology.&lt;br /&gt;
&lt;br /&gt;
 '''March 8, 2012, with the Boston Security Meetup group'''&lt;br /&gt;
&lt;br /&gt;
Location - [http://maps.google.com/maps?q=Jobspring+Partners,+Boylston+Street,+Boston,+MA&amp;amp;hl=en&amp;amp;sll=42.362243,-71.081628&amp;amp;sspn=0.019549,0.037594&amp;amp;oq=jobspring&amp;amp;t=v&amp;amp;hq=Jobspring+Partners,&amp;amp;hnear=Boylston+St,+Boston,+Massachusetts&amp;amp;z=17 JobSpring, Boylston St.]&lt;br /&gt;
&lt;br /&gt;
Topic - '''Corporate Espionage for Dummies: The Hidden Threat of Embedded Web Servers'''&lt;br /&gt;
&lt;br /&gt;
Speaker - VP for Security Research at ZScaler, along with other speakers at the security meetup.&lt;br /&gt;
 &lt;br /&gt;
Today, everything from kitchen appliances to television sets come with an IP address. Network connectivity for various hardware devices opens up exciting opportunities. Forgot to lower the thermostat before leaving the house? Simply access it online. Need to record a show? Start the DVR with a mobile app. While embedded web servers are now as common as digital displays in hardware devices, sadly, security is not. What if that same convenience exposed photocopied documents online or allowed outsiders to record your telephone conversations? A frightening thought indeed.&lt;br /&gt;
 &lt;br /&gt;
Software vendors have been forced to climb the security learning curve. As independent researchers uncovered embarrassing vulnerabilities, vendors had little choice but to plug the holes and revamp development lifecycles to bake security into products. Vendors of embedded web servers have faced minimal scrutiny and as such are at least a decade behind when it comes to security practices. Today, network connected devices are regularly deployed with virtually no security whatsoever.&lt;br /&gt;
 &lt;br /&gt;
The risk of insecure embedded web servers has been amplified by insecure networking practices. Every home and small business now runs a wireless network, but it was likely set up by someone with virtually no networking expertise. As such, many devices designed only for LAN access are now unintentionally Internet facing and wide open to attack from anyone, regardless of their location.&lt;br /&gt;
 &lt;br /&gt;
Leveraging the power of cloud based services, Zscaler spent several months scanning large portions of the Internet to understand the scope of this threat. Our findings will make any business owner think twice before purchasing a 'wifi enabled' device. We'll share the results of our findings, reveal specific vulnerabilities in a multitude of appliances and discuss how embedded web servers will represent a target rich environment for years to come. &lt;br /&gt;
&lt;br /&gt;
 '''December 13, 2011, 6:30, Microsoft NERD, Cambridge, Horace Mann Room'''&lt;br /&gt;
&lt;br /&gt;
'''Jeremiah Grossman – Founder and CTO WhiteHat Security'''&lt;br /&gt;
 &lt;br /&gt;
Directions: http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx&lt;br /&gt;
&lt;br /&gt;
 '''September 14 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Dinis Cruz   -  OWASP O2 Platform'''&lt;br /&gt;
&lt;br /&gt;
The O2 Platform is focused on automating application security knowledge and workflows. It is a library of scriptable objects specifically designed for developers and security consultants to be able to perform quick, effective and thorough source code-driven application security reviews (blackbox + whitebox). &lt;br /&gt;
&lt;br /&gt;
 '''September 7 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Adriel Desautels –  Differences between Penetration Testing and Vulnerability Scanning'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July  2011'''&lt;br /&gt;
&lt;br /&gt;
'''Anurag Agarwal, the founder of MyAppSecurity'''&lt;br /&gt;
&lt;br /&gt;
'''Session 1 - Managing Risk with Threat Modeling''' &lt;br /&gt;
Threat Modeling can help by guiding the Application Development Teams to ensure your Security Policies get properly coded into the Applications at time of Development.  By creating pre-approved methods of coding for your development teams, and applying them in a repeatable and scalable process, you can assist your development teams in building a secure application easily and effortlessly.&lt;br /&gt;
&lt;br /&gt;
'''Session 2 - False Positive, False Negative and False Sense of Security''' &lt;br /&gt;
This interactive session will talk about the pros and cons of using black box testing tools and discuss their effectiveness in building a mature software security program. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday June 2'''&lt;br /&gt;
&lt;br /&gt;
Location - '''Microsoft NERD''' - http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx &lt;br /&gt;
&lt;br /&gt;
'''Topic - Bringing Sexy Back: Defensive Measures That Actually Work''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Paul Asadoorian, Founder &amp;amp;amp; CEO, PaulDotCom Enterprises &lt;br /&gt;
&lt;br /&gt;
There is a plethora of information available on how to break into systems, steal information, and compromise users. As a penetration tester, I have performed testing on a regular basis that reveals severe security weaknesses in several organizations, and many of my peers have reported on the same. However, once you &amp;quot;own&amp;quot; the network and report on how you accomplished your goals, now what? Sure, we make defensive recommendations, but consistently it has been proven that security can be bypassed. Not enough focus is given to what works defensively. We have a lot of technology at our disposal: firewalls, intrusion detection, log correlation, but it provides little protection from today's threats and is often not implemented effectively. This talk will focus on taking an offensive look at defense. Applying techniques that are simple, yet break the mold of traditional defensive measures. We will explore setting up &amp;quot;traps&amp;quot; for attackers, slowing them down with simple scripts, using honeypots, planting bugs, and most importantly tying these methods to &amp;quot;enterprise security&amp;quot;. This talk will also include real-world examples of the techniques in action from a live, heavily attacked site. Topics will include: &lt;br /&gt;
&lt;br /&gt;
*Using wireless “attacks” on the attackers&lt;br /&gt;
*Implementing the Metasploit Decloak engine to find the attackers&lt;br /&gt;
*Setting traps to detect web application attacks&lt;br /&gt;
*Integrating results into your enterprise log management tool&lt;br /&gt;
&lt;br /&gt;
The goal of this talk is to make defense “sexy”… &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian is currently the &amp;quot;Product Evangelist&amp;quot; for Tenable Network Security, where he showcases vulnerability scanning and management through blogs, podcasts and videos. Paul is also the founder of PaulDotCom, an organization centered around the award winning &amp;quot;PaulDotCom Security Weekly&amp;quot; podcast that brings listeners the latest in security news, vulnerabilities, research and interviews with the security industry's finest. Paul has a background in penetration testing, intrusion detection, and is the co-author of &amp;quot;WRT54G Ultimate Hacking&amp;quot;, a book dedicated to hacking Linksys routers. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday May 26'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
'''Topic - OWASP Top 10 issue #4 – Insecure Direct Object Reference''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels and President of OWASP Boston &lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss threat models, risks and various remediations of issue #4 in the 2010 OWASP Top 10 – Insecure Direct Object References. &lt;br /&gt;
&lt;br /&gt;
'''Topic - A Web-Application Architecture for Regulatory Compliant Cloud Computing''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Arshad Noor, StrongAuth &lt;br /&gt;
&lt;br /&gt;
The emergence of cloud-computing as an alternative deployment strategy for IT systems presents many opportunities, yet challenges traditional notions of data-security. The fact that data-security regulations are developing teeth, leaves information technology professionals perplexed on how to take advantage of cloud-computing while proving compliance to regulations for protecting sensitive information. &lt;br /&gt;
&lt;br /&gt;
This presentation presents an architecture for building the next generation of web-applications. This architecture allows you to leverage emerging technologies such as cloud-computing, cloud-storage and enterprise key-management (EKM) to derive benefits such as lower costs, faster time-to-market and immense scalability with smaller investments - while proving compliance to PCI-DSS, HIPAA/HITECH and similar data-security regulations. &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Arshad Noor is the CTO of StrongAuth, Inc, a Silicon Vally-based company that specializes in enterprise key management. He is the designer and lead-developer of StrongKey, the industry's first open-source Symmetric Key Management System, and the KeyAppliance - the industry's first appliance combining encryption, tokenization, key-management and a cryptographic hardware module at an unprecedented value. He has written many papers and spoken at many forums on the subject of encryption and key-management over the years. &lt;br /&gt;
&lt;br /&gt;
 ''' CANCELLED   ''' &lt;br /&gt;
&lt;br /&gt;
'''Topic – Secure Application design and Coding''' -- CANCELLED &lt;br /&gt;
&lt;br /&gt;
Presenter - Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
'''Speaker Bio ''' &lt;br /&gt;
&lt;br /&gt;
 '''April 2011'''&lt;br /&gt;
&lt;br /&gt;
Ed Adams Security Innovation -- the new OWASP Exams Project and the work being done by the OWASP Academies Working Group &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2011'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
Owning the world, one mobile app at a time, and web services pen testing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Febrary 2011'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO of Safelight Security - &lt;br /&gt;
&lt;br /&gt;
Security Leadership series: Delivering a successful security presentation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2010'''&lt;br /&gt;
&lt;br /&gt;
Application Architecture Security Assessment - Second session &lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2010'''&lt;br /&gt;
&lt;br /&gt;
Open SAMM – Software Assurance Maturity Model &lt;br /&gt;
&lt;br /&gt;
Shakeel Tufail is the Federal Practice Manager at Fortify, an HP company. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors Overview: In this highly interactive two-part workshop, Rob Cheyne of Safelight Security will show you the basics of conducting a real-world architecture &amp;amp;amp; design review. This workshop draws from Safelight's Security Architecture Fundamentals training course, a two-day course frequently used to teach Fortune 500 companies how to look at their system architectures from both the hacker's and the designer’s point of view. &lt;br /&gt;
&lt;br /&gt;
 '''July 2010'''&lt;br /&gt;
&lt;br /&gt;
Lightning Talk – Rob Cheyne, CEO Safelight Security Advisors In this installment of the Safelight lightning talks series, Rob will present the basics of a Cross-site Request Forgery (CSRF). &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Drive-by Pharming with MonkeyFist &lt;br /&gt;
&lt;br /&gt;
Joey Peloquin - Director of Application Security, Fishnet Security &lt;br /&gt;
&lt;br /&gt;
 '''June 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - topic to be announced &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Ryan Barnett The Web Hacking Incident Database (WHID) is a Web Application Security Consortium project dedicated to maintaining a list of web applications related security incidents. Ryan Barnett is director of application security research at Breach Security where he leads Breach Security Labs. &lt;br /&gt;
&lt;br /&gt;
 '''May 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - SQL Injection &lt;br /&gt;
&lt;br /&gt;
Vinnie Liu - Data Exposure, New Approaches to Open Source Intelligence Techniques, and Incident Handling &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2010'''&lt;br /&gt;
&lt;br /&gt;
Dan Hestad Security Innovation Dan will be talking about his experiences with PCI and web applications, and answering questions about do's and don'ts of acceptable PCI practices in web applications. &lt;br /&gt;
&lt;br /&gt;
 '''March 2010'''&lt;br /&gt;
&lt;br /&gt;
Zack Lanier - Disclosure Samsara, or &amp;quot;the endless vulnerability disclosure debate&amp;quot; &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.html &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.pdf (very large PDF) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne of Safelight Security Advisors; New Technology, Same Old Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2010 at Microsoft NERD, Cambridge'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 Technologies &lt;br /&gt;
&lt;br /&gt;
 '''December 2009'''&lt;br /&gt;
&lt;br /&gt;
Eric Bender, Cenzic &lt;br /&gt;
&lt;br /&gt;
 '''November 2009'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels - Web Application Vulnerability Scanners &lt;br /&gt;
&lt;br /&gt;
Mush Hakhinian, Leader, Application Security Practice, IntraLinks - Secure coding with no money down using SONAR: unleashing the power of open-source code analysis tools &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2009'''&lt;br /&gt;
&lt;br /&gt;
Paul Schofield, Senior Security Engineer, Imperva - From Rivals to BFF: WAF &amp;amp;amp; VA Unite &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2009 at CORE Technologies, Boston'''&lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian, Pauldotcom.com &lt;br /&gt;
&lt;br /&gt;
Alex Horan, CORE Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2009'''&lt;br /&gt;
&lt;br /&gt;
Joey Peloquin, Fishnet Security, Secure SDLC: The Good, the Bad and the Ugly [http://www.owasp.org/images/4/48/SecureSDLC-GoodBadUgly.pdf presentation pdf] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2009'''&lt;br /&gt;
&lt;br /&gt;
Sabha Kazerooni, Security Compass - Exploit Me tools; Framework Level Threat Analysis &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5a/Security_Compass_Exploilt_Me.pdf ExploitMe Document] &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/e/ef/Security_Compass_Framework-level_Threat_Analysis.pdf Framework Level Threat Analysis document] &lt;br /&gt;
&lt;br /&gt;
Meeting Pizza Sponsor - Arcot &lt;br /&gt;
&lt;br /&gt;
Arcot is a leader in online fraud prevention, strong authentication and eDocument security. Arcot's solutions are easily deployed, low-cost and extremely scalable, allowing organizations to transparently protect their users from fraud without changing user behavior or requiring expensive hardware. &lt;br /&gt;
&lt;br /&gt;
Arcot can be contacted thru Michael Kreppein, michael.kreppein@arcot.com, 617-467-5200 &lt;br /&gt;
&lt;br /&gt;
 '''December 2008'''&lt;br /&gt;
&lt;br /&gt;
Brian Holyfield, Gothem Digital Science &lt;br /&gt;
&lt;br /&gt;
Tamper Proofing Web Applications http://www.gdssecurity.com/l/b/2008/12/04/ &lt;br /&gt;
&lt;br /&gt;
 '''June 2008'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman; Founder and CTO, Whitehat Security &lt;br /&gt;
&lt;br /&gt;
Appetizer - Hacking Intranets from the Outside (Just when you thought your network was safe) Port scanning with JavaScript &lt;br /&gt;
&lt;br /&gt;
Main Topic - Business Logic Flaws: How they put your Websites at Risk &lt;br /&gt;
&lt;br /&gt;
 '''March 2008'''&lt;br /&gt;
&lt;br /&gt;
Chris Eng; Senior Director, Security Research, Veracode &lt;br /&gt;
&lt;br /&gt;
Description – Attacking crypto in web applications &lt;br /&gt;
&lt;br /&gt;
 '''December 2007'''&lt;br /&gt;
&lt;br /&gt;
Scott Matsumoto; Principal Consultant, Cigital &lt;br /&gt;
&lt;br /&gt;
Description – You Say Tomayto and I Say Tomahto – Talking to Developers about Application Security &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/5/5b/BostonOWASP200712-Cigital.pdf Cigital Presentation] &lt;br /&gt;
&lt;br /&gt;
 '''November 2007'''&lt;br /&gt;
&lt;br /&gt;
Tom Mulvehill Ounce Labs &lt;br /&gt;
&lt;br /&gt;
Description – Tom will share his knowledge and expertise on implementing security into the software development life cycle. This presentation will cover how to bring practicality into secure software development. Several integration models will be explored as well as solutions for potential obstacles &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/f/f8/Ounce_OWASP_07NOV07ppt.zip Ounce presentation] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2007'''&lt;br /&gt;
&lt;br /&gt;
George Johnson, Principal Software Engineer EMC; CISSP &lt;br /&gt;
&lt;br /&gt;
An Introduction to Threat Modeling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2007'''&lt;br /&gt;
&lt;br /&gt;
Day of Worldwide OWASP 1 day conferences on the topic &amp;quot;Privacy in the 21st Century&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 '''June 2007'''&lt;br /&gt;
&lt;br /&gt;
Tool Talk - Jim Weiler - WebGoat and Crosssite Request Forgeries &lt;br /&gt;
&lt;br /&gt;
Danny Allan; Director, Security Research, Watchfire &lt;br /&gt;
&lt;br /&gt;
Topic: Exploitation of the OWASP Top 10: Attacks and Strategies &lt;br /&gt;
&lt;br /&gt;
 '''March 2007'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman, CTO Whitehat Security: Top 10 Web Application Hacks of 2006 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2007'''&lt;br /&gt;
&lt;br /&gt;
Dave Low, RSA the Security Division of EMC: encryption case studies &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2006'''&lt;br /&gt;
&lt;br /&gt;
Mike Gavin, Forrester Research: Web Application Firewalls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''June 2006'''&lt;br /&gt;
&lt;br /&gt;
Imperva - Application and Database Vulnerabilities and Intrusion Prevention &lt;br /&gt;
&lt;br /&gt;
Jim Weiler - Using Paros Proxy Server as a Web Application Vulnerability tool &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2006'''&lt;br /&gt;
&lt;br /&gt;
Dennis Hurst; SPI Dynamics: A study of AJAX Hacking &lt;br /&gt;
&lt;br /&gt;
Jim Weiler; OWASP Boston: Using Paros HTTP proxy, part 1. first meeting with all demos, no powerpoints! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2006'''&lt;br /&gt;
&lt;br /&gt;
Mateo Meucci; OWASP Italy [http://www.owasp.org/images/8/8c/Anatomy_of_2_Web_App_Testing.zip Anatomy of 2 web attacks] &lt;br /&gt;
&lt;br /&gt;
Tom Stracener; Cenzic Web Application Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2006'''&lt;br /&gt;
&lt;br /&gt;
Ron Ben Natan; Guardium CTO Database Security: Protecting Identity Information at the Source &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2006'''&lt;br /&gt;
&lt;br /&gt;
David Low, Senior Field Engineer: RSA Practical Encryption &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2005'''&lt;br /&gt;
&lt;br /&gt;
Paul Galwas, Product Manager: nCipher [http://www.owasp.org/docroot/owasp/misc/OWASP051207.ppt Enigma variations: Key Management controlled] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2005'''&lt;br /&gt;
&lt;br /&gt;
Robert Hurlbut, Independent Consultant [http://www.owasp.org/docroot/owasp/misc/OWASP_Hurlbut_ThreatModelingforWebApplicaitons.zip Threat Modeling for web applications] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2005'''&lt;br /&gt;
&lt;br /&gt;
Prateek Mishra, Ph.D. Director, Security Standards and Strategy: Oracle Corp Chaiman of the OASIS Security Services (SAML) Technical Committee - [http://www.owasp.org/docroot/owasp/misc/Federation-Introduction-Overview-01.ppt Identity Federation&amp;amp;nbsp;: Prospects and Challenges] &lt;br /&gt;
&lt;br /&gt;
Ryan Shorter, Sr. System Engineer: Netcontinuum - Application Security Gateways &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2005'''&lt;br /&gt;
&lt;br /&gt;
Dr. Herbert Thompson, Chief Security Strategist: SecurityInnovation - How to Break Software Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''July 2005'''&lt;br /&gt;
&lt;br /&gt;
Mark O'Neill, CTO: Vordel - [http://www.owasp.org/docroot/owasp/misc/MarkOneill.pdf Giving SOAP a REST? A look at the intersection of Web Application Security and Web Services Security] &lt;br /&gt;
&lt;br /&gt;
 '''June 2005'''&lt;br /&gt;
&lt;br /&gt;
Arian Evans, National Practice Lead, Senior Security Engineer: Fishnet Security [http://www.owasp.org/conferences/appsec2005dc/schedule.html Overview of Application Security Tools] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2005'''&lt;br /&gt;
&lt;br /&gt;
Patrick Hynds, CTO: Critical Sites - [http://www.owasp.org/docroot/owasp/misc/Passwords-Keys_to_the_Kingdom_Dev_V1.ppt Passwords - Keys to the Kingdom] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2005'''&lt;br /&gt;
&lt;br /&gt;
Jonathan Levin - [http://www.owasp.org/docroot/owasp/misc/JLevinRandoms.pdf Of Random Numbers] &lt;br /&gt;
&lt;br /&gt;
Jothy Rosenberg, Founder and CTO: Service Integrity - [http://www.owasp.org/docroot/owasp/misc/JothyRWebSvcsSec.ppt Web Services Security] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2005'''&lt;br /&gt;
&lt;br /&gt;
Joe Stagner: Microsoft Let's talk about Application Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Feb 2005'''&lt;br /&gt;
&lt;br /&gt;
Application Security Inc. PowerPoint slides for the [http://www.owasp.org/docroot/owasp/misc/Anatomy+of+an+Attack.ppt Anatomy of a Database Attack.]&lt;br /&gt;
&lt;br /&gt;
== Local Chapter Information ==&lt;br /&gt;
&lt;br /&gt;
To find out more about the Boston chapter, just join the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. &lt;br /&gt;
&lt;br /&gt;
The chapter shipping/mailing address is: &lt;br /&gt;
&lt;br /&gt;
OWASP Boston &amp;lt;br /&amp;gt;&lt;br /&gt;
35 Wachusett Dr &amp;lt;br /&amp;gt;&lt;br /&gt;
Lexington, MA 02421 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Reviews_of_security_podcasts Reviews of security podcasts]&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/2017_BASC_Homepage Boston Application Security Conference 2017] &lt;br /&gt;
&lt;br /&gt;
[[2016 BASC Homepage|Boston Application Security Conference 2016]]&lt;br /&gt;
&lt;br /&gt;
[[2015 BASC Homepage|Boston Application Security Conference 2015]]&lt;br /&gt;
&lt;br /&gt;
[[2014 BASC Homepage|Boston Application Security Conference 2014]]&lt;br /&gt;
&lt;br /&gt;
[[2013 BASC Homepage|Boston Application Security Conference 2013]]&lt;br /&gt;
&lt;br /&gt;
[[2012 BASC Homepage|Boston Application Security Conference 2012]] &lt;br /&gt;
&lt;br /&gt;
[[2011 BASC Homepage|Boston Application Security Conference 2011]] &lt;br /&gt;
&lt;br /&gt;
[[2010 BASC Homepage|Boston Application Security Conference 2010]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Boston OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
'''Contact'''&lt;br /&gt;
&lt;br /&gt;
* Email the [mailto:boston-leaders@owasp.org chapter leaders].&lt;br /&gt;
&lt;br /&gt;
'''President''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:jim.weiler@owasp.org Jim Weiler] &lt;br /&gt;
&lt;br /&gt;
'''Board of Directors''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:lindaleigh.aberdale@owasp.org LindaLeigh Aberdale]&lt;br /&gt;
* [mailto:mark.arnold@owasp.org Mark Arnold] &lt;br /&gt;
* [mailto:tom.conner@owasp.org Tom Conner] &lt;br /&gt;
* [mailto:mike.perez@owasp.org Mike Perez]&lt;br /&gt;
* [mailto:roy.wattanasin@owasp.org Roy Wattanasin]&lt;br /&gt;
* [mailto:pedro.marcano@owasp.org Pedro Marcano]&lt;br /&gt;
* [mailto:Mark.Schlepphorst@owasp.org Mark Schlepphorst] &lt;br /&gt;
* [mailto:Ori.Zigindere@owasp.org Ori Zigindere] &lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
[[Category:Boston]] &lt;br /&gt;
[[Category:OWASP_Chapter]] &lt;br /&gt;
[[Category:Massachusetts]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Boston&amp;diff=251034</id>
		<title>Boston</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Boston&amp;diff=251034"/>
				<updated>2019-05-04T03:36:08Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Chapter Meetings --- Our Fifteenth Year */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Boston|extra=Follow @OWASPBOSTON on Twitter. The chapter leader is [mailto:boston@owasp.org Jim Weiler]. The Boston chapter is grateful for support from Constant Contact, Salesforce, Microsoft and Akamai for generously hosting space and their hospitality for various events.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
The Chapter would also like to thank our sponsors for their generous support.|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Boston|emailarchives=http://lists.owasp.org/pipermail/owasp-Boston}}&lt;br /&gt;
&lt;br /&gt;
== Chapter Sponsor ==&lt;br /&gt;
[[File:SIlogostacked.png|Security Innovation|https://www.securityinnovation.com/]]&lt;br /&gt;
&lt;br /&gt;
[[File:Veracode logo.png|Veracode|https://www.veracode.com/]]&lt;br /&gt;
&lt;br /&gt;
== Boston Application Security Conference ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Boston-Banner-468x60.gif|link=2018_BASC_Homepage]] [[Image:twitter_32.png|link=https://twitter.com/@BASConf]] BASC 2019, the Boston Application Security Conference will take place 8:30am to 6:30pm on Saturday, October 19th at Microsoft, 5 Wayside Road, Burlington, MA.  [[2018 BASC Homepage|Read more]]&lt;br /&gt;
&lt;br /&gt;
== Chapter Meetings --- Our Fifteenth Year ==&lt;br /&gt;
&lt;br /&gt;
We now use [http://www.meetup.com/owaspboston/ meetup] to organize meetings.&lt;br /&gt;
&lt;br /&gt;
We meet whenever a speaker and a venue have available dates,  6:30 to 9 pm. &lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to come to any meeting, there is no signup or joining criteria, just come if it sounds interesting. You can join the OWASP Boston Google group at https://groups.google.com/a/owasp.org/forum/#!forum/boston-chapter. This list is very low volume (2 - 3 emails/month); it is used to remind people about each monthly meeting, inform about local application security events and special chapter offers. &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Information for meeting updates about this and other Boston area user groups can also be found at [http://bug.bostonusergroups.org/Lists/Groups%20Calendar/calendar.aspx BostonUserGroups]. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upcoming Meetings&lt;br /&gt;
&lt;br /&gt;
CMD+CTRL  Web Application Hacking Cyber Range  May 22, 2019 @ 6:00-9:00pm  Athena Health Watertown&lt;br /&gt;
&lt;br /&gt;
Want to test your skills in identifying web app vulnerabilities?  Join OWASP Boston, Athena Health and Security Innovation as members compete in CMD+CTRL, a web application cyber range where players exploit their way through hundreds of vulnerabilities that lurk in business applications today.  Success means learning quickly that attack and defense is all about thinking on your feet. Standard capture the flag using network and operating attack skills will not be much use here; understanding the OWASP Top 10 risks will help you find the vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
For each vulnerability you uncover, you are awarded points. Climb the interactive leaderboard for a chance to win prizes! CMD+CTRL is ideal for development teams to train and develop skills, but anyone involved in keeping your organization’s data secure can play - from developers and managers and even CISOs.&lt;br /&gt;
&lt;br /&gt;
YOU CAN ONLY REGISTER ON THE SECURITY INNOVATION REGISTRATION SITE AT THIS LINK - &amp;lt;nowiki&amp;gt;https://web.securityinnovation.com/athenahealth2019&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Register early to reserve your spot !&lt;br /&gt;
&lt;br /&gt;
Just bring a laptop. Pizza and soda will be provided.&lt;br /&gt;
&lt;br /&gt;
Venue/Location of the event:&lt;br /&gt;
&lt;br /&gt;
Athena Health&lt;br /&gt;
&lt;br /&gt;
311 Arsenal St.&lt;br /&gt;
&lt;br /&gt;
Watertown, MA 02472&lt;br /&gt;
&lt;br /&gt;
See the attached map -&lt;br /&gt;
&lt;br /&gt;
Park in only P2 visitor lot or in garages P1 and P3. Parking is free.&lt;br /&gt;
&lt;br /&gt;
The main lobby door is at “S1” shuttle pickup icon.&lt;br /&gt;
&lt;br /&gt;
Enter the lobby and sign in at the front desk to pick up credentials.&lt;br /&gt;
&lt;br /&gt;
Directions to the event room will be provided at that time&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Training ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Past Meetings ===&lt;br /&gt;
&lt;br /&gt;
''January 29th, 2019'' - Cambridge [https://web.securityinnovation.com/owaspboston2019 Partnered with Security Innovation]&lt;br /&gt;
&lt;br /&gt;
Location: [https://goo.gl/maps/w11GUuJJAbo Quick Base office]&lt;br /&gt;
&lt;br /&gt;
5PM- '''Just bring your computer and evil inner-doer and you are ready to roll!'''&lt;br /&gt;
&lt;br /&gt;
Security Innovation is teaming up with OWASP Boston to offer attendees a fun &amp;quot;find the vulnerabilities&amp;quot; game - CMD+CTRL Cyber Range - that shows how hackers break into websites and teaches the importance of secure coding habits.  &lt;br /&gt;
&lt;br /&gt;
The CMD+CTRL Cyber Range we will be using is called ShadowBank, a banking website where players compete to find vulnerabilities, score points, and move up the leaderboard.  Leveraging cheat sheets, attack tables, and expert led training sessions, platers take their shot at stealing money, manipulating share prices, and conducting other nefarious acts.&lt;br /&gt;
  &lt;br /&gt;
 ''June 14th, 2017'' - Burlington [https://www.meetup.com/owaspboston/events/240033562/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
7:00 pm  ''' Is RASP Ready?'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection is overhyped, according to many analysts and pundits. RASP promises applications that protect themselves - which sounds impossible - how can an application possibly protect itself? An agent that sits inside the app sounds like a deployment nightmare at worst, and a drain on the app at best. What’s the reality? Where are we now and what have we learned? &lt;br /&gt;
&lt;br /&gt;
We’ve seen deployment successes and failures, and we will draw from those specific experiences to describe: &lt;br /&gt;
Where does RASP work? &lt;br /&gt;
* What applications are well-suited for RASP? &lt;br /&gt;
* What types (organizational structure, culture, or skillset) of organizations are well-suited for RASP?&lt;br /&gt;
&lt;br /&gt;
What is the reality of RASP? &lt;br /&gt;
* Is RASP a deployment model or a feature set? &lt;br /&gt;
* How mature is RASP? Is it an over-hyped immature space, enterprise-ready, or somewhere in between? &lt;br /&gt;
* Which RASP capabilities do organizations use? And how do they validate those capabilities in their own environments? &lt;br /&gt;
* Can RASP replace the WAF?&lt;br /&gt;
&lt;br /&gt;
We will conclude, not with a sales pitch, but some lessons learned on: the three must have attributes for RASP, some suggestions on good candidates for RASP – both types of teams and types of applications, and finally - if, how, and when to get started. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Michael Feiertag, CEO and Co-Founder, tCell &lt;br /&gt;
Before co-founding tCell at the end of 2014, Michael led a string of successful products – most recently as head of products at Okta, and prior to that, as technology director at Blue Coat. Prior to Blue Coat, Michael held product management, engineering, and sales positions at several start-ups. Michael holds a B.S. from The University of Chicago, and an M.S. from the University of Maryland&lt;br /&gt;
&lt;br /&gt;
 '''May 2, 2017''' - Burlington [https://www.meetup.com/owaspboston/events/239130768/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
6:50 pm  '''Random Number Generation - Lava Lamps, Clouds, New Standards and the IoT - Richard Moulds'''&lt;br /&gt;
&lt;br /&gt;
The SANS Institute recently listed &amp;quot;Weak random number generators&amp;quot; as one of the 7 most dangerous security techniques to watch in 2017. But how do you really know how good your random numbers are? Virtualization and IoT make things worse and new standards are a wake-up call. Random numbers are the basis of security for all cryptography, yet they are often taken for granted. Without entropy, crypto is just math.  &lt;br /&gt;
&lt;br /&gt;
Learn why random numbers are so hard to generate and validate, compare different technologies in use today across virtualized environments, and discuss operational steps to take the risk out of random numbers and help secure cryptosystems even into the era of quantum computers. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Richard Moulds, General Manager of Whitewood Security, has spoken at RSA 2017 and at several OWASP chapter events in New York, Chicago and Austin. Richard has over 20 years of experience in the area of cryptography and encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2, 2016''' - Cambridge [https://www.meetup.com/owaspboston/events/234648485/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 90 Broadway, Cambridge, MA 02142 (down the street from the usual location)&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
7:00 '&amp;lt;nowiki/&amp;gt;''Advanced Persistent Legal Threats''' - '''''&amp;lt;nowiki/&amp;gt;'''William Gamble, JD, LLM, EMBA'''&lt;br /&gt;
&lt;br /&gt;
Abstract: Good cyber security can protect IT infrastructure against many attacks. Because of the difficulty in monetizing cyber thefts, the direct loss of a breach can be limited. However, the legal costs, both from government agencies and plaintiffs, can be far greater. The legal landscape, both in the US and internationally is changing as fast if not faster than the technology.&lt;br /&gt;
&lt;br /&gt;
Bio: I am a lawyer and a member of the Florida Bar.I used to practice tax, securities and banking law. I have written three books and spoken around the world on the economic efficiency of legal and regulatory infrastructures specifically in emerging markets like China. Over the past two years, I have immersed myself in cyber security. I now hold the CompTIA A+, Network+, and Security+. I will take the CASP next month. Besides keeping up with the regulations, I am studying incident response and auditing. I am also working toward my health care law certification. My hero is Dr. Johannes Ullrich.&lt;br /&gt;
&lt;br /&gt;
 '''September 28, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/233921522/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
6:15 '''OWASP Top 10 #1 - Injection Flaws'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss XML External Entity Injection flaws; how it works, how to prevent, code examples.&lt;br /&gt;
&lt;br /&gt;
6:45 '&amp;lt;nowiki/&amp;gt;''From the Frontlines of RASP Adoption''' - '''''&amp;lt;nowiki/&amp;gt;'''Goran Begic, VP of Product, IMMUNIO'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection (RASP) is one of the newest technologies coined by Gartner and it is in early stages of adoption in the industry. It promises dynamic defense and automatic mitigation of vulnerabilities in web applications.&lt;br /&gt;
&lt;br /&gt;
This presentation is a summary of experiences from several dozens of commercial evaluations and early adoptions in production that took place this year and provides some examples of situations and challenges that are not specific to any individual vendor. In this talk Goran will provide an overview of buying criteria and evaluation requirements across different industries and some typical pitfalls that can slow down adoption.&lt;br /&gt;
&lt;br /&gt;
After the introduction and a brief reminder on the technology Goran will invite audience to participate in discussion about organizational requirements for adoption and operationalization of RASP. &lt;br /&gt;
&lt;br /&gt;
Questions for discussion: &lt;br /&gt;
&lt;br /&gt;
My application is under attack. &lt;br /&gt;
*What actions should I take? &lt;br /&gt;
*Who owns the response? &lt;br /&gt;
*Which attacks should I respond to and which ones can I ignore?&lt;br /&gt;
*How to get started with mitigation provided by technology? &lt;br /&gt;
*Does RASP fit with DevOps? &lt;br /&gt;
*Does RASP help with remediation? &lt;br /&gt;
&lt;br /&gt;
What this presentation is not: This is not a product pitch in any way. Evaluation criteria, comparison of RASP with IAST and other security technologies, personal experiences and examples discussed in this talk are generally applicable to all RASP solutions. &lt;br /&gt;
&lt;br /&gt;
Key takeaways:&lt;br /&gt;
&lt;br /&gt;
At the end of the presentation you will: &lt;br /&gt;
*get a better understanding of requirements for evaluation of RASP and its use cases, &lt;br /&gt;
*if you can pull a successful evaluation alone, or if you will need participation of other groups / teams &lt;br /&gt;
*learn about critical criteria for success of RASP in production &lt;br /&gt;
*how this criteria different relative to appsec testing tools.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 7, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Docker Containers and Application Security''' - '''Tsvi Korren'''&lt;br /&gt;
&lt;br /&gt;
Docker containers are transforming the way applications are developed and deployed. Closely tied to DevOps and Continuous Delivery, containers introduce both risks and opportunities to security management in Web applications. This talk will introduce the basic concepts of containers, how companies use them today and how to support this technology while elevating the security posture of your application stacks.&lt;br /&gt;
&lt;br /&gt;
Tsvi Korren, CISSP, has been an enterprise IT professional for 20 years with background in business process consulting in large organizations. Most recently at CA Technologies, he worked across verticals in government, retail, financial institutions and healthcare to implement compliance and security processes, from Identity and Access to Host and Server Controls. Tsvi is currently the director of technical services at Aqua, concentrating on building bridges between DevOps and Security.&lt;br /&gt;
&lt;br /&gt;
 '''June 8, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/230842887/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6-6:30 '''News, announcements, job postings, etc. '''&lt;br /&gt;
&lt;br /&gt;
6:30-7 '''Introduction to SQL Injection - Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Computer Science Curricula’s Failure - What Should We Do Now?''' - '''Ming Chow &amp;amp; Roy Wattanasin'''&lt;br /&gt;
&lt;br /&gt;
We are still facing the same security vulnerabilities from over a decade ago. The problems are not going away anytime soon and a reason is because Computer Science curricula are still churning out students who are not even exposed to security. This talk will address the lack of emphasis on information security in Computer Science curricula, how CS curricula have an obligation, how to gradually fix the problem by integrating security into many Computer Science undergraduate and graduate classes, and success stories from students. This talk will also discuss what Tufts and Brandeis are currently working on to further address the security education problem by creating a joint cyber security and policy program that spans multiple departments. Additional points and feedback from the audience are encouraged to help with the issue. All are encourage to attend to submit your feedback to help!&lt;br /&gt;
&lt;br /&gt;
Presenters: &lt;br /&gt;
&lt;br /&gt;
Ming Chow - @0xmchow &lt;br /&gt;
&lt;br /&gt;
Ming Chow is a Senior Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He was a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World, DEF CON, Intel, SOURCE Conference, and BSides Boston. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2014 and 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin - @wr0 &lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin is an adjunct faculty at Brandeis University in both the Health and Medical Informatics and Information Security graduate programs. He spends most of his time leading, teaching and developing information security programs, finding vulnerabilities, performing incident response and working on many projects. Roy has spoken at many conferences including RSA, ISSA International, Source Conference, Braintank, Cyber Security World, OWASP and the Security BSides conferences. He is also a healthcare information security professional. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2015. &lt;br /&gt;
&lt;br /&gt;
 '''May 4, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229788205/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Slightly different [http://www.akamai.com/html/about/locations.html Akamai] location: 90 Broadway, Cambridge, MA 02142 between Meadhall and the Mariott&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZAP''' - '''Dan Cornell'''&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons to use source code to assist in web application penetration testing such as making better use of penetration testers’ time, providing penetration testers with deeper insight into system behavior, and highlighting specific sections of so development teams can remediate vulnerabilities faster. Examples of these are provided using the open source ThreadFix plugin for the OWASP ZAP proxy and dynamic application security testing tool. These show opportunities attendees have to enhance their own penetration tests given access to source code.&lt;br /&gt;
&lt;br /&gt;
This presentation covers the “ABCs” of source code assisted web application penetration testing: covering issues of attack surface enumeration, backdoor identification, and configuration issue discovery. Having access to the source lets an attacker enumerate all of the URLs and parameters an application exposes – essentially its attack surface. Knowing these allows pen testers greater application coverage during testing. In addition, access to source code can help to identify potential backdoors that have been intentionally added to the system. Comparing the results of blind spidering to a full attack surface model can identify items of interest such as hidden admin consoles or secret backdoor parameters. Finally, the presentation examines how access to source code can help identify configuration settings that may have an adverse impact on the security of the deployed application.&lt;br /&gt;
&lt;br /&gt;
Dan Cornell is a globally recognized application security expert, Dan Cornell holds over 15 years of experience architecting, developing and securing web-based software systems. As the Chief Technology Officer and a Principal at Denim Group, Ltd., he leads the technology team to help Fortune 500 companies and government organizations integrate security throughout the development process. He is also the original creator of ThreadFix, Denim Group's industry leading application security program management platform. Cornell was Principal Investigator as Denim Group researched and developed the Hybrid Analysis Mapping (HAM) technology that lies at the heart of ThreadFix, through a Small Business Innovation Research (SBIR) contract with the Department of Homeland Security's Science and Technology Directorate.&lt;br /&gt;
&lt;br /&gt;
More information at: http://www.denimgroup.com/about_team_dan.html&lt;br /&gt;
&lt;br /&gt;
 '''April 6, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Runtime Application Self-Protection (RASP) Tools''' - '''Kunal Anand'''&lt;br /&gt;
&lt;br /&gt;
This talk will highlight the latest in AppSec and dive into a different kind of solution called Runtime Application Self-Protection (RASP). We'll also explore a new methodology called language theoretic security (LANGSEC) and explain how it can outperform existing approaches like pattern matching, regular expressions, etc. This talk will lay the foundation via informal and formal theory how lexers, tokenizers and parsers work. We’ll move onto constructing an open source toolchain to analyzing data and exploring interactive data visualizations. Along the way, we’ll cover performance tradeoffs and discuss the challenges of modern application security.&lt;br /&gt;
&lt;br /&gt;
Kunal Anand is the co-founder and CTO of Prevoty, a runtime application security platform. Prior to that, he was the Director of Technology at the BBC Worldwide, overseeing engineering and operations across the company’s global Digital Entertainment and Gaming initiatives. Kunal also has several years of experience leading security, data and engineering at Gravity, MySpace and NASA’s JetPropulsion Laboratory. His work has been featured in Wired Magazine and Fast Company. Kunal received a B.S. from Babson College.&lt;br /&gt;
&lt;br /&gt;
=== Past Training ===&lt;br /&gt;
&lt;br /&gt;
 '''March 16, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/229156529/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Demandware, Burlington.&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
6:30 '''Software Security by the Numbers''' - '''Chris Eng'''&lt;br /&gt;
&lt;br /&gt;
Deep dive into data we’ve collected about the state of software security in 2016 &lt;br /&gt;
* Based on scans of 200,000+ applications over an 18-month period &lt;br /&gt;
* How different industries and programming languages compare to one another &lt;br /&gt;
* Vulnerability remediation habits and patterns &lt;br /&gt;
* Three characteristics of a successful AppSec program &lt;br /&gt;
&lt;br /&gt;
Chris Eng is vice president of research at Veracode. In this role, he leads the team responsible for integrating security expertise into all aspects of Veracode’s technology. Throughout his career, he has led projects breaking, building, and defending web applications and commercial software for some of the world’s largest companies. Chris is a frequent speaker at premier industry conferences, where he has presented on a diverse range of topics, including cryptographic attacks, agile security, mobile application security, and security metrics. He has been interviewed by Bloomberg, Fox Business, CBS, and other media outlets worldwide.&lt;br /&gt;
&lt;br /&gt;
 '''January 26, 2016''' - Waltham - [http://www.meetup.com/owaspboston/events/228202040/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Waltham.  Trapelo Rd. exit from Rt. 128, toward Lincoln. The parking lot entrance is on the right, at the first traffic light. Drive around to the front of the office complex, facing the highway. Enter under the clock tower. Park in the front of the building and enter in the main building lobby, continue down the hallway and you will see the innovation center, enter in the large glass doors. &lt;br /&gt;
&lt;br /&gt;
7:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:20 '''What Security Testing Tools Miss'''&lt;br /&gt;
&lt;br /&gt;
Black Duck Software presents - Static analysis, dynamic analysis, and other testing tools are all essential weapons against adversaries.  But for the 80%+ of companies worldwide that use open source software in their application development these tools are ineffective in identifying and mitigating open source security risks . This presentation will cover:&lt;br /&gt;
&lt;br /&gt;
The value of static and dynamic tools, and where they best fit in the Secure Development Lifecycle          &lt;br /&gt;
&lt;br /&gt;
Why these tools are not useful in identifying known vulnerabilities in open source components          &lt;br /&gt;
&lt;br /&gt;
Controls development and security professionals can deploy to select, detect, manage and monitor open source for existing and newly disclosed vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Food will be provided by Constant Contact.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2015''' - Cambridge - [http://www.meetup.com/owaspboston/events/226394218/ Meetup]&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
Attendee interaction is always mentioned as a high value at meetings and was great at the MetroWest meetings, so we're doing that at Akamai this month. Some discussion starters so far: SSL certificate impacts from CA/Browser alliance decisions and SHA1 weakness; mutual (client) SSL, javascript client and server side; what the heck is threat intelligence, dev ops and faster secure SDLC.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Metrowest&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 20, 7:00 pm&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Innovation Center, Reservoir Place, 1601 Trapelo Road, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
7:00 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:30 '''Access in Maliceland - Risk Based Access Control''' - '''Gunnar Peterson'''&lt;br /&gt;
&lt;br /&gt;
John Lambert observed attackers win because while defenders think in lists, attackers think in graphs. Access control systems divide the system a priori into secure and insecure states. But that’s only worth the paper its printed on. A  Attackers see the system as it is, for attackers, the access control scheme is the beginning of the game not the end. Determined attackers seek out access control models and then find holes that they can leverage. Access control systems that purport to protect the system are built on assumptions from which reality diverges. Application security needs a new approach to access control- adding feedback loops for risk based decisions,  fine-grained, dynamic access control. &lt;br /&gt;
&lt;br /&gt;
Security is a business with a very long list of issues and requirements. The spreadsheets are miles long. This makes it essential to find reusable solution patterns that can address multiple problems.This presentation looks at both medium term improvements and code examples to improve access control decisions and overall security today&lt;br /&gt;
&lt;br /&gt;
Gunnar Peterson ([https://twitter.com/oneraindrop @oneraindrop]) focuses on security architecture consulting and training. Experience includes Associate Editor for IEEE Security &amp;amp; Privacy Journal, a Microsoft MVP for App security, an IANS Research Faculty member, a Securosis Contributing Analyst, and a Visiting Scientist at Carnegie Mellon Software Engineering Institute. He maintains a popular information security blog at http://1raindrop.typepad.com.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Cambridge&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 8, 6:30 pm  ''NOTE: It's the second Wednesday this month.''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
 '''June 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Put Down the Megaphone: Effective Security Advocacy Without the Shouting''' - '''Darren Meyer'''&lt;br /&gt;
&lt;br /&gt;
10 years’ experience in the InfoSec community--including work with organizations in many verticals, in sizes ranging from startups to Fortune 50 enterprises, leading Application Security teams, building and delivering security instruction to developers, managers, and InfoSec professionals—has taught me the importance of crafting advocacy for different audiences. In this talk, I share my experiences in learning to be an effective advocate with three key audiences: developers, management, and non-technical staff.&lt;br /&gt;
&lt;br /&gt;
Darren is an Application Security advocate and researcher, technology hobbyist, and maker. He loves to learn, teach, nerd out, and inflict terrible puns on people. His background includes logistics, software development, and an assortment of information security roles including leading AppSec programs and professional security instruction targeting developers, managers, and InfoSec professionals.&lt;br /&gt;
&lt;br /&gt;
 '''May 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How the crowd is discovering critical vulns missed by traditional methods''' - '''Leif Dreizler'''&lt;br /&gt;
&lt;br /&gt;
State of the art security programs are turning to bug bounties to leverage a vast array of skill-sets and knowledge. Learn why these programs work, when to deploy them, and how you can bring these new application security testing capabilities into your own organization. The speaker will discuss real world examples from bug bounties and focus on cases where business logic flaws and high priority vulnerabilities were found ... even with existing security testing processes in place. &lt;br /&gt;
&lt;br /&gt;
Attendees will learn:&lt;br /&gt;
&lt;br /&gt;
Testing methods deployed by our crowd that help them find bugs the scanners miss&lt;br /&gt;
&lt;br /&gt;
Examples of the high quality of bugs our crowd is finding, including P1'sTrends which vulnerability types are found most often and whyWhat is the ROI on the pay for performance modelWhere does the SDLC merge into crowdsourced testing&lt;br /&gt;
&lt;br /&gt;
Leif Dreizler is a Senior Security Engineer at Bugcrowd, the innovator in crowdsourced security testing for the enterprise. Prior to joining Bugcrowd, Leif was a Senior Application Security Engineer at Redspin, performing application security assessments. During his time at Redspin he also served as the Application Team Lead, liaising with clients at the engineering and sales level. He has also made minor contributions to the Firebug project. Leif attended the University of California, Santa Barbara where he studied Computer Science. Leif recently spoke to the NYC Security Meet-up group.&lt;br /&gt;
&lt;br /&gt;
 '''April 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler Will show some actual examples and patterns of SQL Injection attempts&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Are You An Imposter? Me too!''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
Many people in the information security field feel like a fraud, or an imposter. In reality, we often know far more, and are capable of far more than we believe we do. There is so much to know and we constantly hear about the latest groundbreaking research done by others, which makes us feel less important or worthy. Let’s talk about what Imposter Syndrome is, its prevalence, and then we can start to realize just how capable we are and go forward with the confidence in the field.&lt;br /&gt;
&lt;br /&gt;
 '''March 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, March 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Prioritizing Web Application Vulnerabilities – A Hacker’s Perspective''' - '''Nick Silver'''&lt;br /&gt;
&lt;br /&gt;
The best application risk models capture not only the technical risk factors, but also the business context in which an asset lives.  Traditionally, this is done by auditing application owners on an array of questions in order to properly classify the asset and its data – but that takes time which could be better spent elsewhere.  We interviewed dozens of hackers and asked them which vulnerabilities they would look for first depending on the type of attack they wanted to carry out.  We’ll walk through several examples of how to use this data as a shortcut means for prioritizing risk without the need for any pesky audit questionnaires.&lt;br /&gt;
&lt;br /&gt;
Nick Silver is a Senior Solutions Architect with WhiteHat Security.  He is responsible for translating business requirements into technical ones and assisting businesses in implementing web security programs.  Previously, Nick led a team in WhiteHat’s Threat Research Center where they were responsible for testing more than 2,000 of their customers’ websites for vulnerabilities.  &lt;br /&gt;
&lt;br /&gt;
 '''February 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, announcements''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Incident Response and Web Application Security - Stories from the Trenches''' - '''Fred House and Joe Ceirante'''&lt;br /&gt;
&lt;br /&gt;
Mandiant has conducted numerous incident response engagements throughout its history, including a record number of 200 incidents in 2014. Mandiant consultants Fred House and Joe Ceirante will discuss case studies and trends Mandiant has observed in relation to web application security.&lt;br /&gt;
 &lt;br /&gt;
Topics will include the types of threat actors that target web applications, the techniques they use to compromise web applications, and the activities they perform once inside the network. Techniques for detecting and mitigating web compromises will also be reviewed. All content will be derived from the real-world compromises that Mandiant has investigated.&lt;br /&gt;
&lt;br /&gt;
 '''January 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 7, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, risk analysis of Poodle''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How a Hacker Views Your Web Site''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
''The most popular presentation of BASC 2014''&lt;br /&gt;
&lt;br /&gt;
As defenders, we have to be right 100% of the time where an attacker only needs to be right once. The attack surface of a modern web site is incredibly large and we need to be aware of all of it. Additionally, individual attacks may not always be effective but sometimes using them together can gain the desired effect. In this talk, we’ll take a look at the whole attack surface for a typical web site and the various ways that an attacker will use to compromise a site.&lt;br /&gt;
&lt;br /&gt;
 '''December 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, December 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News and Views You Can Use and Abuse''' - '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
* Some thoughts and analysis on some current app security news and other stuff&lt;br /&gt;
* Adobe password breach&lt;br /&gt;
* Reducing Web Application Firewall SQL injection false positives&lt;br /&gt;
 &lt;br /&gt;
7:15 '''Swift and Security''' - '''Ming Chow'''&lt;br /&gt;
 &lt;br /&gt;
Apple is pushing its new programming language Swift for iOS development and for many good reasons.  This talk will discuss what the language has right in terms of security, the old and new security pitfalls, and what developers need to be aware of moving forward with using the new language.  The fact to the matter is, iOS isn't going away, iOS developers will need to learn and use Swift, and there will be a big rush of Swift-based apps: we might as well learn how to do it right the first time around.&lt;br /&gt;
 &lt;br /&gt;
Ming Chow is an Instructor at the Department of Computer Science, Tufts University. Ten years of web development experience.&lt;br /&gt;
Specialties: Web and Mobile Development, Web and Mobile Security&lt;br /&gt;
&lt;br /&gt;
 '''July 2014'''&lt;br /&gt;
&lt;br /&gt;
Topics: '''Grails Security''' and '''Validating Cross-Site Scripting Vulns with xssValidator'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Cyrus Malekpour''' and '''John Poulin'''&lt;br /&gt;
&lt;br /&gt;
When: Tuesday, July 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic 1: ''Grails Security''&lt;br /&gt;
&lt;br /&gt;
Grails is a framework developed for Groovy in the vein of Rails for Ruby. It provides a lot of features for web app security, but does it do enough? What might you need to implement yourself, and what might be provided? This presentation will discuss tips on securing Grails applications, including tools that the framework provides by default for security. It'll also discuss several shortcomings in the current toolset, and how you can avoid them.&lt;br /&gt;
 &lt;br /&gt;
Cyrus Malekpour (@cmalekpour) is currently interning at nVisium, working on web app development and security. He's currently an undergraduate student at the University of Virginia, where he's studying computer science with an emphasis on security and backend development. &lt;br /&gt;
 &lt;br /&gt;
Topic 2: ''Validating Cross-Site Scripting Vulns with xssValidator''&lt;br /&gt;
 &lt;br /&gt;
xssValidator is a tool developed to automate the testing and validation of Cross-Site Scripting (xss) vulnerabilities within web applications. Automated scanners tend to report large amounts of false-positives, and as consultants we're forced spending our time trying to verify these findings. xssValidator leverages scriptable web-browsers such as PhantomJS and Slimer.js to automatically validate these findings.&lt;br /&gt;
 &lt;br /&gt;
John Poulin is an application security consultant for nVisium who specializes in web application security. He worked previously as a web developer and software engineer that focused on building multi-tier web applications. When he's not hacking on web apps, John spends his time building tools to help him hack on web apps! You can find him on twitter: @forced_request and on myspace: REDACTED.&lt;br /&gt;
&lt;br /&gt;
 '''June 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection and the OWASP Zed Attack Proxy (ZAP)'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Rob Cheyne and Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 - general networking, news discussion, announcements.&lt;br /&gt;
&lt;br /&gt;
7:00 - main presentations&lt;br /&gt;
&lt;br /&gt;
The June 4th meeting will be the second in our series of 2014 training meetings. Rob Cheyne will continue explaining and exploring SQL Injection by conducting an actual injection attack.&lt;br /&gt;
&lt;br /&gt;
This will be a demo-based discussion to get into the mindset of an attacker, and show how an attacker goes after a site. Demo will include: &lt;br /&gt;
&lt;br /&gt;
* BurpProxy demo &lt;br /&gt;
* Common authentication flaws &lt;br /&gt;
* SQL Injection Demo that shows the process and how it builds to a full compromise&lt;br /&gt;
&lt;br /&gt;
'''Rob Cheyne''' is currently CEO of Big Brain Security. In addition to security consulting for Fortune 500 customers, he was the author of LC4, a version of the award-winning L0phtCrack password auditing tool, and he also worked on the code scanning technology that was eventually spun off as Veracode. Rob was at @stake from the very first customer all the way through to the $50M acquisition by Symantec.&lt;br /&gt;
&lt;br /&gt;
'''Jim Weiler''' will introduce the OWASP Zed Attack Proxy (ZAP). This is a very powerful free OWASP intercepting proxy that lets you see, analyze, change, replay etc. every browser request and response, analyze your session, scan and attack web sites, save the results and run reports. We can't cover all the functionality but we'll show some practical tips and techniques.&lt;br /&gt;
&lt;br /&gt;
Pizza, salad and soda courtesy of Akamai&lt;br /&gt;
&lt;br /&gt;
 '''March 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection, WebGoat, Cross Site Request Forgery'''&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
When: Wednesday, March 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
There will be three training sessions:&lt;br /&gt;
&lt;br /&gt;
One will be on SQL Injection - intro, detection, prevention, scanning and false positives. This is the most serious web application vulnerability.&lt;br /&gt;
&lt;br /&gt;
The second will be on OWASP WebGoat. WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons. You can install and practice with WebGoat in either J2EE or in ASP.NET. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat applications. There are hints and 39 different lesson plans on various vulnerabilities and technologies. We won't cover all of them of course!&lt;br /&gt;
&lt;br /&gt;
The third will be on Cross Site Request Forgery - not a hack really, it's just the way the web works. But it causes apps to do legitimate things that you didn't ask them to do.&lt;br /&gt;
&lt;br /&gt;
Pizza and drinks provided by Akamai.&lt;br /&gt;
&lt;br /&gt;
 '''January 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''JavaScript Verification: From Browsers to Pages'''&lt;br /&gt;
&lt;br /&gt;
Modern web browsers implement a &amp;quot;private browsing&amp;quot; mode that is intended to leave behind no traces of a user's browsing activity on their computer. This feature is in direct tension with support for *extensions*, which let users add third-party functionality into their browser. I will discuss the scope of this problem, present our approach to verifying extensions' compliance with private browsing mode, and sketch our findings on several real, third-party extensions. I will then briefly describe the toolkit underlying our approach, and end with a sketch of a newer project, adapting this approach to the very different-seeming problem of statically catching errors when using the jQuery library.&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
&lt;br /&gt;
Benjamin Lerner has just completed a post-doctoral research position in the PLT group at Brown University, and is now a lecturer at Northeastern University.  His research examines the challenges of analyzing client-side web programming, from the behavior of web pages down through the semantics of the browser.  He received a PhD in Computer Science from the University of Washington in 2011, building a platform to analyze conflicts between browser extensions, and a B.S. in Computer Science and Mathematics from Yale University.&lt;br /&gt;
&lt;br /&gt;
 '''November 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Attacking iOS Applications'''  &lt;br /&gt;
&lt;br /&gt;
Slides: [http://www.slideshare.net/kfosaaen/i-os-gcandpb On slideshare]&lt;br /&gt;
&lt;br /&gt;
This presentation will cover the basics of attacking iOS applications (and their back ends) using a web proxy to intercept, modify, and repeat HTTP/HTTPS requests. (The proxy used during research was Burp; however, any HTTP intercepting proxy such as OWASP ZAP could be used) From setting up the proxy to pulling data from the backend systems, this talk will be a great primer for anyone interested in testing iOS applications at the HTTP protocol level. There will be a short (2 minute) primer on setting up the intercepting proxy, followed by three practical examples showing how to intercept data headed to the phone, how to modify data heading to the application server, and how to pull extra data from application servers to further an attack. All of these examples will focus on native iOS apps (Game Center and Passbook) and/or functionality (Passbook Passes).&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Karl Fosaaen'''&lt;br /&gt;
&lt;br /&gt;
Karl is a senior security consultant at NetSPI. This role has allowed Karl to work in a variety of industries, including financial services, health care, and hardware manufacturing. Karl specializes in network and web application penetration testing. In his spare time, Karl helps out as an OPER at THOTCON and a swag goon at DEF CON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''October 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, October 2, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Abusing NoSQL Databases'''&lt;br /&gt;
&lt;br /&gt;
The days of selecting from a few SQL database options for an application are over. There is now a plethora of NoSQL database options to choose from: some are better than others for certain jobs. There are good reasons why developers are choosing them over traditional SQL databases including performance, scalabiltiy, and ease-of-use. Unfortunately like for many hot techologies, security is largely an afterthought in NoSQL databases. This short but concise presentation will illustrate how poor the quality of security in many NoSQL database systems is. This presentation will not be confined to one particular NoSQL database system. Two sets of security issues will be discussed: those that affect all NoSQL database systems such as defaults, authentication, encryption; and those that affect specific NoSQL database systems such as MongoDB and CouchDB. The ideas that we now have a complicated heterogeneous problem and that defense-in-depth is even more necessary will be stressed. There is a common misconception that SQL injection attacks are eliminated by using a NoSQL database system. While specifically SQL injection is largely eliminated, injection attack vectors have increased thanks to JavaScript and the flexibility of NoSQL databases. This presentation will present and demo new classes of injection attacks. Attendees should be familiar with JavaScript and JSON. &lt;br /&gt;
&lt;br /&gt;
Presenter: '''Ming Chow'''&lt;br /&gt;
&lt;br /&gt;
Ming Chow (@tufts_cs_mchow) is a Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He teaches courses largely in the undergraduate curriculum including the second course in the major sequence, Web Programming, Music Apps on the iPad, and Introduction to Computer Security. He was also a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World (2011 and 2012), DEF CON 19 (2011), the Design Automation Conference (2011), Intel, and the SOURCE Conference (Boston 2013). Ming's projects in information security include building numerous CTF challenges, Internet investigations, HTML5 and JavaScript security, and Android forensics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 2013 - Joint Meeting with [http://www.meetup.com/Boston-cloud-services/ Boston Cloud Services]''' &lt;br /&gt;
&lt;br /&gt;
When: Tuesday, September 10, 6 pm&lt;br /&gt;
&lt;br /&gt;
Location: Microsoft NERD Center ''(not our usual location)''&lt;br /&gt;
&lt;br /&gt;
'''Note: This is a joint meeting. Please register at [http://www.meetup.com/Boston-cloud-services/ the Boston Cloud Services meetup page] if you plan to attend.'''&lt;br /&gt;
&lt;br /&gt;
There will be two presentations at this meeting:&lt;br /&gt;
&lt;br /&gt;
Topic: '''People Centric Security (PCS)'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Nick Stamos'''&lt;br /&gt;
&lt;br /&gt;
People Centric Security (PCS) is a new security model, presented as part of Gartner's Maverick Research 2 year ago. PCS is well suited for Cloud Business/Consumer services such as Dropbox, Google Drive, SkyDrive, etc. PCS enables users to have what they desire, and provides enterprises what they require for data governance and compliance. Nick Stamos co-founded his fourth company, nCrypted Cloud in July of 2012. His past startups include Verdasys, Phase Forward (IPO FY2004, $685M Oracle Acquisition 2010), and Amulet. He studied at Tufts University where he received a BSEE and MSEE.&lt;br /&gt;
&lt;br /&gt;
Topic: '''SSL Certs'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
Practical experiences with issuing and risk assessing SSL certs for enterprise applications on a cloud provider: who creates the CSR, how do you protect the private key on the cloud server, certs on cloud provider managed load balancers vrs 3rd party managed app servers, roles and responsibilities of cloud IT, 3rd party developer IT, enterprise IT and service providers. Jim Weiler is Application Security Architect at Starwoods Hotels and the Chapter Leader of OWASP Boston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July 2013 - Doubleheader!'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 10, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Topic: '''RailsGoat'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Ken Johnson'''&lt;br /&gt;
&lt;br /&gt;
Abstract: While working to secure rails applications in a truly Agile development environment, it became clear that the Rails and Ruby ecosystem needed attention from the security community in the form of free and open training, and the events that have transpired within the last few months have only reinforced that belief. [http://railsgoat.cktricky.com/ RailsGoat] is an attempt to bring attention to both the problems that most frequently occur in Rails as well as the solutions for remediation. To accomplish this, we've built a vulnerable Rails application that aligns with the OWASP Top 10 and can be used as a training tool for Rails-based development shops.&lt;br /&gt;
&lt;br /&gt;
Topic: '''PhoneGap on Android'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Jack Mannino'''&lt;br /&gt;
&lt;br /&gt;
Abstract: PhoneGap is a widely used framework that allows developers to rapidly build cross-platform mobile applications using HTML5, JavaScript, and CSS. Using PhoneGap plugins, developers can call native platform APIs from browser-like applications using JavaScript. This approach introduces vulnerabilities that are not typically as prevalent within native Android applications, warranting a fresh look at the way we view mobile applications. In this presentation, we will take a deep look at the Android implementation of the framework and we will examine the overall attack surface for applications. Real-world examples of vulnerable applications will be demonstrated as well in order to provide context, entertainment, and enjoyment.&lt;br /&gt;
&lt;br /&gt;
About the Speakers:&lt;br /&gt;
&lt;br /&gt;
Ken Johnson is the former Manager of LivingSocial.com's application security team where he built their security program before leaving for his true home as the CTO of nVisium Security, a VA-based application security company. Ken is the primary developer of the Web Exploitation Framework and contributes to other open source application security projects as often as time permits. He has spoken at AppSec DC 2010 and 2012, OWASP NoVA and Phoenix chapters, Northern Virginia Hackers Association (NoVAH) and is a contributor to the Attack Research team.&lt;br /&gt;
&lt;br /&gt;
Jack Mannino is the CEO of nVisium Security, a VA-based application security company. At nVisium, he helps to ensure that large corporations, government agencies, and software startups have the tools they need to build and maintain successful security initiatives. He is an active Android security researcher/tinkerer, and has a keen interest in identifying security issues and trends on a large scale. Jack is a leader and founder of the OWASP Mobile Security Project. He is the lead developer for the OWASP GoatDroid project, and is the chairman of the OWASP Northern Virginia chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''June 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''We see the future…and it isn’t pretty'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Andrea Mulligan, Sr. Director at Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
In this session Andrea presents research findings from the State of Software Security Report, which offers a before the breach look at security by examining the flaws commonly found in applications of all kinds. She will also examine what the research findings mean for security, predict how these flaws could cause history to repeat itself, and discuss how security pros can help change the future. &lt;br /&gt;
&lt;br /&gt;
 '''May 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Systems Thinking + Web Security'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Akamai'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Akamai will present on ‘Systems Thinking + Web Security’. There will also be an audience review exercise facilitated by the Akamai presenters.  This is a great chance to hear some interesting perspectives on web security from Akamai, who handles about one third of all internet traffic.&lt;br /&gt;
&lt;br /&gt;
 '''April 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Go Fast. Be Secure: Effectively Govern the Use of Open Source Components Throughout the SDLC'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Sonotype'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
* Open Source Software (OSS) Component supply chain complexities and realities. Open source is constantly changing and knowing the version in your software, as well as the current version history of the component (how do you show an auditor you are using a current version) is important. &lt;br /&gt;
* Open Source Consumption Patterns from the Central Repository. Which versions are the most popular can tell you which versions are the most stable, useful, secure etc.&lt;br /&gt;
* OWASP Top 10 (A9) - Using Components with Known Vulnerabilities. To decide on the risk of OSS components with vulnerabilities, you need to know the vulnerabilities, their severity and which components they occur in as well as where in the code dependency tree they are. &lt;br /&gt;
* OSS Security, Quality and License policies must be woven into the development process. Knowing the number and type of open source licenses in your software can be important to the legal standing of your code and if it conflicts with any corporate standards. The licensing is also important in order to know the restrictions on changing the software.&lt;br /&gt;
* OSS Component Policy Examples&lt;br /&gt;
* Example Application Compositions Reports&lt;br /&gt;
* Example Use cases IDE, CI, repository, production applications&lt;br /&gt;
* Discussion&lt;br /&gt;
&lt;br /&gt;
About Sonatype:&lt;br /&gt;
&lt;br /&gt;
Sonatype operates the Central Repository, the industry's primary source for open-source components, housing more than 400,000 components and serving more than five billion requests per year from more than 60,000 organizations. The company has been a pioneer in component-based software development since its founding by Jason van Zyl, the creator of the Apache Maven build management system and the Central Repository. &lt;br /&gt;
&lt;br /&gt;
 '''March 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''What is BSIMM?'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Nabil Hannan'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Nabil is Director of Vulnerability Assessments and Managing Consultant at Cigital.&lt;br /&gt;
 &lt;br /&gt;
The purpose of the BSIMM is to quantify the activities carried out by real software security initiatives. BSIMM is a study of the secure development practices of over 50 organizations, analyzed along the dimensions that were found in the data, not along preconceived ideas of what secure development should be.  &lt;br /&gt;
&lt;br /&gt;
BSIMM describes the work of 974 software security group members working with a satellite of 2039 people to secure the software developed by 218,286 developers. &lt;br /&gt;
&lt;br /&gt;
The BSIMM describes 111 activities that any organization can put into practice. The activities are described in twelve practices grouped into four domains. Associated with each activity is an objective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''February 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''BroBot'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Eric Kobrin, Akamai'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Eric Kobrin is a Senior Security Architect in the Infosec organization of Akamai Technologies, the global leader in Cloud-based application acceleration and content delivery. Eric has been involved in Software Architecture for over 15 years, having worked at such companies and IBM, Velocitude and eDiets.com. He has a passion for programming languages, security, and software performance and has worked in all layers of the software stack from hypervisors to complex servers and web applications. Eric's works have been published, presented at international conferences and patented.&lt;br /&gt;
 &lt;br /&gt;
His presentation will provide an analysis of the BroBot DDOS attacks, including discussion of:&lt;br /&gt;
&lt;br /&gt;
* Vulnerable system discovery&lt;br /&gt;
* Zombie compromise&lt;br /&gt;
* Control structure&lt;br /&gt;
* Attack traffic&lt;br /&gt;
* Mitigation steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''January 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Third-Party Application Analysis: Best Practices and Lessons Learned'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Chad Holmes, Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Chad Holmes will present details of the work Veracode has been doing with their 3rd Party program, discuss the technical and business challenges that have arisen during that time and lead a discussion on what team members can do to help drive adoption of security best practices across their vendor community.&lt;br /&gt;
&lt;br /&gt;
The flow of the presentation is designed to drive discussion within an audience – both from a technical and business perspective with some anecdotal stories. Chad wants this to be an interactive discussion so he’ll have questions and you should bring yours I’ve already sent him some.  The order of the presentation is:&lt;br /&gt;
&lt;br /&gt;
·         Adoption rates of externally developed software&lt;br /&gt;
&lt;br /&gt;
·         The risk within those apps&lt;br /&gt;
&lt;br /&gt;
·         Some deeper stats on what “3rd party” really means (total outsourcing/total COTS produced/open source/imported libraries/etc)&lt;br /&gt;
&lt;br /&gt;
·         Some raw data about our experiences (to show this is based on a large sample size rather than “Look how awesome Veracode is!”)&lt;br /&gt;
&lt;br /&gt;
·         Challenges that will be faced (business, intellectual property, policy, analysis capabilities, etc)&lt;br /&gt;
&lt;br /&gt;
·         Best Practices for high rates of adoption&lt;br /&gt;
&lt;br /&gt;
·         Lessons Learned and Recommendations&lt;br /&gt;
&lt;br /&gt;
Chad Holmes has over 10 years of software development and application security experience. During his time at Veracode, Chad has lead the redesign and execution of the third-party analysis process to allow for a more streamlined approach while still addressing common ISV intellectual property concerns. In addition to his third-party analysis responsibilities, Chad's previous work as a Security Program Manager has lead to the successful roll out and improvement of multiple corporate application security groups.&lt;br /&gt;
&lt;br /&gt;
 '''June 2012'''&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker '''Will Vandevanter - Rapid 7'''&lt;br /&gt;
&lt;br /&gt;
'''Fingerprinting web applications of all kinds'''&lt;br /&gt;
&lt;br /&gt;
This turbo talk will introduce a new Metasploit module that fingerprints &amp;quot;known&amp;quot; web applications, attempts the default credentials for the application, and runs an associated exploit or authenticated access module if applicable. Some example fingerprints in the database target common enterprise web applications including Microsoft products (Outlook Web Access, Sharepoint), printers (Xerox Document Centre), security cameras, routers, and others. &lt;br /&gt;
&lt;br /&gt;
Will Vandevanter is a senior penetration tester and researcher at Rapid7. His focus interests include web application security and secure code. He has previously spoken at Defcon, SOURCE, BSides LV, and other conferences. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 '''May 31 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Jobspring, Boston. 545 Boylston st. &lt;br /&gt;
&lt;br /&gt;
Speaker - '''Glenn Gramling, Vice President, Cenzic'''&lt;br /&gt;
&lt;br /&gt;
“Cloudy with a Chance of Hack”&lt;br /&gt;
&lt;br /&gt;
Cloud computing is a cost effective and efficient way for enterprises to automate their processes. However organizations need to be aware of the pitfalls of the many cloud solutions out there - one of the main being security. Most cloud applications were built for ease of use and without security necessarily in mind. Companies need to be asking their solution providers about the security measures used in developing the application and get an independent verification to make sure there are no gaping holes. With over 75% of attacks occurring through the Web, any attack through these applications can lead to leakage of confidential information and embarrassment. In this session, we'll give attendees tips and tricks to prepare them for the potential of &amp;quot;stormy weather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Glenn Gramling is responsible for global sales and business development for Cenzic’s  application security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''April 11, 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker - '''David Eoff, Senior Product Marketing Manager, HP Enterprise Security'''&lt;br /&gt;
&lt;br /&gt;
David is a Senior Product Marketing Manager, within the Enterprise Security Products division of HP focused on Fortify application security. His 18+ years of background in software and hardware enterprise marketing provides a solid foundation for his marketing of the HP security solutions. &lt;br /&gt;
 &lt;br /&gt;
Prior to joining Fortify in 2009 and being acquired by HP, David ran Firewall and IPS marketing for the Security division of Nokia Corporation. In addition, he has held multiple positions in product marketing, product management, channel marketing and sales while working for Oracle, EMC, Legato, BMC Software and several start-ups.&lt;br /&gt;
&lt;br /&gt;
Topic - '''Gray, the New Black:  Gray-Box Vulnerability Testing'''&lt;br /&gt;
&lt;br /&gt;
Over the years, two key techniques have emerged as the most effective for finding security vulnerabilities in software:  Dynamic Application Security Testing (DAST) and Static Application Security Testing (SAST).  While DAST and SAST each possess unique strengths, the “Holy Grail” of security testing is thought to be “hybrid” – a technique that combines and correlates the results from both testing methods, maximizing the advantages of each. Until recently, however, a critical element has been missing from first generation hybrid solutions:  information about the inner workings and behavior of applications undergoing DAST and SAST analysis.&lt;br /&gt;
 &lt;br /&gt;
This presentation will introduce you to the next generation of hybrid security analysis – what it is, how it works, and the benefits it offers.  It will also address (and dispel) the claims against hybrid, and leave you with a clear understanding of how the new generation of hybrid will enable organizations to resolve their most critical software security issues faster and more cost-effectively than any other available analysis technology.&lt;br /&gt;
&lt;br /&gt;
 '''March 8, 2012, with the Boston Security Meetup group'''&lt;br /&gt;
&lt;br /&gt;
Location - [http://maps.google.com/maps?q=Jobspring+Partners,+Boylston+Street,+Boston,+MA&amp;amp;hl=en&amp;amp;sll=42.362243,-71.081628&amp;amp;sspn=0.019549,0.037594&amp;amp;oq=jobspring&amp;amp;t=v&amp;amp;hq=Jobspring+Partners,&amp;amp;hnear=Boylston+St,+Boston,+Massachusetts&amp;amp;z=17 JobSpring, Boylston St.]&lt;br /&gt;
&lt;br /&gt;
Topic - '''Corporate Espionage for Dummies: The Hidden Threat of Embedded Web Servers'''&lt;br /&gt;
&lt;br /&gt;
Speaker - VP for Security Research at ZScaler, along with other speakers at the security meetup.&lt;br /&gt;
 &lt;br /&gt;
Today, everything from kitchen appliances to television sets come with an IP address. Network connectivity for various hardware devices opens up exciting opportunities. Forgot to lower the thermostat before leaving the house? Simply access it online. Need to record a show? Start the DVR with a mobile app. While embedded web servers are now as common as digital displays in hardware devices, sadly, security is not. What if that same convenience exposed photocopied documents online or allowed outsiders to record your telephone conversations? A frightening thought indeed.&lt;br /&gt;
 &lt;br /&gt;
Software vendors have been forced to climb the security learning curve. As independent researchers uncovered embarrassing vulnerabilities, vendors had little choice but to plug the holes and revamp development lifecycles to bake security into products. Vendors of embedded web servers have faced minimal scrutiny and as such are at least a decade behind when it comes to security practices. Today, network connected devices are regularly deployed with virtually no security whatsoever.&lt;br /&gt;
 &lt;br /&gt;
The risk of insecure embedded web servers has been amplified by insecure networking practices. Every home and small business now runs a wireless network, but it was likely set up by someone with virtually no networking expertise. As such, many devices designed only for LAN access are now unintentionally Internet facing and wide open to attack from anyone, regardless of their location.&lt;br /&gt;
 &lt;br /&gt;
Leveraging the power of cloud based services, Zscaler spent several months scanning large portions of the Internet to understand the scope of this threat. Our findings will make any business owner think twice before purchasing a 'wifi enabled' device. We'll share the results of our findings, reveal specific vulnerabilities in a multitude of appliances and discuss how embedded web servers will represent a target rich environment for years to come. &lt;br /&gt;
&lt;br /&gt;
 '''December 13, 2011, 6:30, Microsoft NERD, Cambridge, Horace Mann Room'''&lt;br /&gt;
&lt;br /&gt;
'''Jeremiah Grossman – Founder and CTO WhiteHat Security'''&lt;br /&gt;
 &lt;br /&gt;
Directions: http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx&lt;br /&gt;
&lt;br /&gt;
 '''September 14 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Dinis Cruz   -  OWASP O2 Platform'''&lt;br /&gt;
&lt;br /&gt;
The O2 Platform is focused on automating application security knowledge and workflows. It is a library of scriptable objects specifically designed for developers and security consultants to be able to perform quick, effective and thorough source code-driven application security reviews (blackbox + whitebox). &lt;br /&gt;
&lt;br /&gt;
 '''September 7 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Adriel Desautels –  Differences between Penetration Testing and Vulnerability Scanning'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July  2011'''&lt;br /&gt;
&lt;br /&gt;
'''Anurag Agarwal, the founder of MyAppSecurity'''&lt;br /&gt;
&lt;br /&gt;
'''Session 1 - Managing Risk with Threat Modeling''' &lt;br /&gt;
Threat Modeling can help by guiding the Application Development Teams to ensure your Security Policies get properly coded into the Applications at time of Development.  By creating pre-approved methods of coding for your development teams, and applying them in a repeatable and scalable process, you can assist your development teams in building a secure application easily and effortlessly.&lt;br /&gt;
&lt;br /&gt;
'''Session 2 - False Positive, False Negative and False Sense of Security''' &lt;br /&gt;
This interactive session will talk about the pros and cons of using black box testing tools and discuss their effectiveness in building a mature software security program. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday June 2'''&lt;br /&gt;
&lt;br /&gt;
Location - '''Microsoft NERD''' - http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx &lt;br /&gt;
&lt;br /&gt;
'''Topic - Bringing Sexy Back: Defensive Measures That Actually Work''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Paul Asadoorian, Founder &amp;amp;amp; CEO, PaulDotCom Enterprises &lt;br /&gt;
&lt;br /&gt;
There is a plethora of information available on how to break into systems, steal information, and compromise users. As a penetration tester, I have performed testing on a regular basis that reveals severe security weaknesses in several organizations, and many of my peers have reported on the same. However, once you &amp;quot;own&amp;quot; the network and report on how you accomplished your goals, now what? Sure, we make defensive recommendations, but consistently it has been proven that security can be bypassed. Not enough focus is given to what works defensively. We have a lot of technology at our disposal: firewalls, intrusion detection, log correlation, but it provides little protection from today's threats and is often not implemented effectively. This talk will focus on taking an offensive look at defense. Applying techniques that are simple, yet break the mold of traditional defensive measures. We will explore setting up &amp;quot;traps&amp;quot; for attackers, slowing them down with simple scripts, using honeypots, planting bugs, and most importantly tying these methods to &amp;quot;enterprise security&amp;quot;. This talk will also include real-world examples of the techniques in action from a live, heavily attacked site. Topics will include: &lt;br /&gt;
&lt;br /&gt;
*Using wireless “attacks” on the attackers&lt;br /&gt;
*Implementing the Metasploit Decloak engine to find the attackers&lt;br /&gt;
*Setting traps to detect web application attacks&lt;br /&gt;
*Integrating results into your enterprise log management tool&lt;br /&gt;
&lt;br /&gt;
The goal of this talk is to make defense “sexy”… &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian is currently the &amp;quot;Product Evangelist&amp;quot; for Tenable Network Security, where he showcases vulnerability scanning and management through blogs, podcasts and videos. Paul is also the founder of PaulDotCom, an organization centered around the award winning &amp;quot;PaulDotCom Security Weekly&amp;quot; podcast that brings listeners the latest in security news, vulnerabilities, research and interviews with the security industry's finest. Paul has a background in penetration testing, intrusion detection, and is the co-author of &amp;quot;WRT54G Ultimate Hacking&amp;quot;, a book dedicated to hacking Linksys routers. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday May 26'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
'''Topic - OWASP Top 10 issue #4 – Insecure Direct Object Reference''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels and President of OWASP Boston &lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss threat models, risks and various remediations of issue #4 in the 2010 OWASP Top 10 – Insecure Direct Object References. &lt;br /&gt;
&lt;br /&gt;
'''Topic - A Web-Application Architecture for Regulatory Compliant Cloud Computing''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Arshad Noor, StrongAuth &lt;br /&gt;
&lt;br /&gt;
The emergence of cloud-computing as an alternative deployment strategy for IT systems presents many opportunities, yet challenges traditional notions of data-security. The fact that data-security regulations are developing teeth, leaves information technology professionals perplexed on how to take advantage of cloud-computing while proving compliance to regulations for protecting sensitive information. &lt;br /&gt;
&lt;br /&gt;
This presentation presents an architecture for building the next generation of web-applications. This architecture allows you to leverage emerging technologies such as cloud-computing, cloud-storage and enterprise key-management (EKM) to derive benefits such as lower costs, faster time-to-market and immense scalability with smaller investments - while proving compliance to PCI-DSS, HIPAA/HITECH and similar data-security regulations. &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Arshad Noor is the CTO of StrongAuth, Inc, a Silicon Vally-based company that specializes in enterprise key management. He is the designer and lead-developer of StrongKey, the industry's first open-source Symmetric Key Management System, and the KeyAppliance - the industry's first appliance combining encryption, tokenization, key-management and a cryptographic hardware module at an unprecedented value. He has written many papers and spoken at many forums on the subject of encryption and key-management over the years. &lt;br /&gt;
&lt;br /&gt;
 ''' CANCELLED   ''' &lt;br /&gt;
&lt;br /&gt;
'''Topic – Secure Application design and Coding''' -- CANCELLED &lt;br /&gt;
&lt;br /&gt;
Presenter - Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
'''Speaker Bio ''' &lt;br /&gt;
&lt;br /&gt;
 '''April 2011'''&lt;br /&gt;
&lt;br /&gt;
Ed Adams Security Innovation -- the new OWASP Exams Project and the work being done by the OWASP Academies Working Group &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2011'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
Owning the world, one mobile app at a time, and web services pen testing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Febrary 2011'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO of Safelight Security - &lt;br /&gt;
&lt;br /&gt;
Security Leadership series: Delivering a successful security presentation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2010'''&lt;br /&gt;
&lt;br /&gt;
Application Architecture Security Assessment - Second session &lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2010'''&lt;br /&gt;
&lt;br /&gt;
Open SAMM – Software Assurance Maturity Model &lt;br /&gt;
&lt;br /&gt;
Shakeel Tufail is the Federal Practice Manager at Fortify, an HP company. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors Overview: In this highly interactive two-part workshop, Rob Cheyne of Safelight Security will show you the basics of conducting a real-world architecture &amp;amp;amp; design review. This workshop draws from Safelight's Security Architecture Fundamentals training course, a two-day course frequently used to teach Fortune 500 companies how to look at their system architectures from both the hacker's and the designer’s point of view. &lt;br /&gt;
&lt;br /&gt;
 '''July 2010'''&lt;br /&gt;
&lt;br /&gt;
Lightning Talk – Rob Cheyne, CEO Safelight Security Advisors In this installment of the Safelight lightning talks series, Rob will present the basics of a Cross-site Request Forgery (CSRF). &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Drive-by Pharming with MonkeyFist &lt;br /&gt;
&lt;br /&gt;
Joey Peloquin - Director of Application Security, Fishnet Security &lt;br /&gt;
&lt;br /&gt;
 '''June 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - topic to be announced &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Ryan Barnett The Web Hacking Incident Database (WHID) is a Web Application Security Consortium project dedicated to maintaining a list of web applications related security incidents. Ryan Barnett is director of application security research at Breach Security where he leads Breach Security Labs. &lt;br /&gt;
&lt;br /&gt;
 '''May 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - SQL Injection &lt;br /&gt;
&lt;br /&gt;
Vinnie Liu - Data Exposure, New Approaches to Open Source Intelligence Techniques, and Incident Handling &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2010'''&lt;br /&gt;
&lt;br /&gt;
Dan Hestad Security Innovation Dan will be talking about his experiences with PCI and web applications, and answering questions about do's and don'ts of acceptable PCI practices in web applications. &lt;br /&gt;
&lt;br /&gt;
 '''March 2010'''&lt;br /&gt;
&lt;br /&gt;
Zack Lanier - Disclosure Samsara, or &amp;quot;the endless vulnerability disclosure debate&amp;quot; &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.html &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.pdf (very large PDF) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne of Safelight Security Advisors; New Technology, Same Old Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2010 at Microsoft NERD, Cambridge'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 Technologies &lt;br /&gt;
&lt;br /&gt;
 '''December 2009'''&lt;br /&gt;
&lt;br /&gt;
Eric Bender, Cenzic &lt;br /&gt;
&lt;br /&gt;
 '''November 2009'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels - Web Application Vulnerability Scanners &lt;br /&gt;
&lt;br /&gt;
Mush Hakhinian, Leader, Application Security Practice, IntraLinks - Secure coding with no money down using SONAR: unleashing the power of open-source code analysis tools &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2009'''&lt;br /&gt;
&lt;br /&gt;
Paul Schofield, Senior Security Engineer, Imperva - From Rivals to BFF: WAF &amp;amp;amp; VA Unite &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2009 at CORE Technologies, Boston'''&lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian, Pauldotcom.com &lt;br /&gt;
&lt;br /&gt;
Alex Horan, CORE Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2009'''&lt;br /&gt;
&lt;br /&gt;
Joey Peloquin, Fishnet Security, Secure SDLC: The Good, the Bad and the Ugly [http://www.owasp.org/images/4/48/SecureSDLC-GoodBadUgly.pdf presentation pdf] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2009'''&lt;br /&gt;
&lt;br /&gt;
Sabha Kazerooni, Security Compass - Exploit Me tools; Framework Level Threat Analysis &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5a/Security_Compass_Exploilt_Me.pdf ExploitMe Document] &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/e/ef/Security_Compass_Framework-level_Threat_Analysis.pdf Framework Level Threat Analysis document] &lt;br /&gt;
&lt;br /&gt;
Meeting Pizza Sponsor - Arcot &lt;br /&gt;
&lt;br /&gt;
Arcot is a leader in online fraud prevention, strong authentication and eDocument security. Arcot's solutions are easily deployed, low-cost and extremely scalable, allowing organizations to transparently protect their users from fraud without changing user behavior or requiring expensive hardware. &lt;br /&gt;
&lt;br /&gt;
Arcot can be contacted thru Michael Kreppein, michael.kreppein@arcot.com, 617-467-5200 &lt;br /&gt;
&lt;br /&gt;
 '''December 2008'''&lt;br /&gt;
&lt;br /&gt;
Brian Holyfield, Gothem Digital Science &lt;br /&gt;
&lt;br /&gt;
Tamper Proofing Web Applications http://www.gdssecurity.com/l/b/2008/12/04/ &lt;br /&gt;
&lt;br /&gt;
 '''June 2008'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman; Founder and CTO, Whitehat Security &lt;br /&gt;
&lt;br /&gt;
Appetizer - Hacking Intranets from the Outside (Just when you thought your network was safe) Port scanning with JavaScript &lt;br /&gt;
&lt;br /&gt;
Main Topic - Business Logic Flaws: How they put your Websites at Risk &lt;br /&gt;
&lt;br /&gt;
 '''March 2008'''&lt;br /&gt;
&lt;br /&gt;
Chris Eng; Senior Director, Security Research, Veracode &lt;br /&gt;
&lt;br /&gt;
Description – Attacking crypto in web applications &lt;br /&gt;
&lt;br /&gt;
 '''December 2007'''&lt;br /&gt;
&lt;br /&gt;
Scott Matsumoto; Principal Consultant, Cigital &lt;br /&gt;
&lt;br /&gt;
Description – You Say Tomayto and I Say Tomahto – Talking to Developers about Application Security &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/5/5b/BostonOWASP200712-Cigital.pdf Cigital Presentation] &lt;br /&gt;
&lt;br /&gt;
 '''November 2007'''&lt;br /&gt;
&lt;br /&gt;
Tom Mulvehill Ounce Labs &lt;br /&gt;
&lt;br /&gt;
Description – Tom will share his knowledge and expertise on implementing security into the software development life cycle. This presentation will cover how to bring practicality into secure software development. Several integration models will be explored as well as solutions for potential obstacles &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/f/f8/Ounce_OWASP_07NOV07ppt.zip Ounce presentation] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2007'''&lt;br /&gt;
&lt;br /&gt;
George Johnson, Principal Software Engineer EMC; CISSP &lt;br /&gt;
&lt;br /&gt;
An Introduction to Threat Modeling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2007'''&lt;br /&gt;
&lt;br /&gt;
Day of Worldwide OWASP 1 day conferences on the topic &amp;quot;Privacy in the 21st Century&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 '''June 2007'''&lt;br /&gt;
&lt;br /&gt;
Tool Talk - Jim Weiler - WebGoat and Crosssite Request Forgeries &lt;br /&gt;
&lt;br /&gt;
Danny Allan; Director, Security Research, Watchfire &lt;br /&gt;
&lt;br /&gt;
Topic: Exploitation of the OWASP Top 10: Attacks and Strategies &lt;br /&gt;
&lt;br /&gt;
 '''March 2007'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman, CTO Whitehat Security: Top 10 Web Application Hacks of 2006 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2007'''&lt;br /&gt;
&lt;br /&gt;
Dave Low, RSA the Security Division of EMC: encryption case studies &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2006'''&lt;br /&gt;
&lt;br /&gt;
Mike Gavin, Forrester Research: Web Application Firewalls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''June 2006'''&lt;br /&gt;
&lt;br /&gt;
Imperva - Application and Database Vulnerabilities and Intrusion Prevention &lt;br /&gt;
&lt;br /&gt;
Jim Weiler - Using Paros Proxy Server as a Web Application Vulnerability tool &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2006'''&lt;br /&gt;
&lt;br /&gt;
Dennis Hurst; SPI Dynamics: A study of AJAX Hacking &lt;br /&gt;
&lt;br /&gt;
Jim Weiler; OWASP Boston: Using Paros HTTP proxy, part 1. first meeting with all demos, no powerpoints! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2006'''&lt;br /&gt;
&lt;br /&gt;
Mateo Meucci; OWASP Italy [http://www.owasp.org/images/8/8c/Anatomy_of_2_Web_App_Testing.zip Anatomy of 2 web attacks] &lt;br /&gt;
&lt;br /&gt;
Tom Stracener; Cenzic Web Application Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2006'''&lt;br /&gt;
&lt;br /&gt;
Ron Ben Natan; Guardium CTO Database Security: Protecting Identity Information at the Source &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2006'''&lt;br /&gt;
&lt;br /&gt;
David Low, Senior Field Engineer: RSA Practical Encryption &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2005'''&lt;br /&gt;
&lt;br /&gt;
Paul Galwas, Product Manager: nCipher [http://www.owasp.org/docroot/owasp/misc/OWASP051207.ppt Enigma variations: Key Management controlled] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2005'''&lt;br /&gt;
&lt;br /&gt;
Robert Hurlbut, Independent Consultant [http://www.owasp.org/docroot/owasp/misc/OWASP_Hurlbut_ThreatModelingforWebApplicaitons.zip Threat Modeling for web applications] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2005'''&lt;br /&gt;
&lt;br /&gt;
Prateek Mishra, Ph.D. Director, Security Standards and Strategy: Oracle Corp Chaiman of the OASIS Security Services (SAML) Technical Committee - [http://www.owasp.org/docroot/owasp/misc/Federation-Introduction-Overview-01.ppt Identity Federation&amp;amp;nbsp;: Prospects and Challenges] &lt;br /&gt;
&lt;br /&gt;
Ryan Shorter, Sr. System Engineer: Netcontinuum - Application Security Gateways &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2005'''&lt;br /&gt;
&lt;br /&gt;
Dr. Herbert Thompson, Chief Security Strategist: SecurityInnovation - How to Break Software Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''July 2005'''&lt;br /&gt;
&lt;br /&gt;
Mark O'Neill, CTO: Vordel - [http://www.owasp.org/docroot/owasp/misc/MarkOneill.pdf Giving SOAP a REST? A look at the intersection of Web Application Security and Web Services Security] &lt;br /&gt;
&lt;br /&gt;
 '''June 2005'''&lt;br /&gt;
&lt;br /&gt;
Arian Evans, National Practice Lead, Senior Security Engineer: Fishnet Security [http://www.owasp.org/conferences/appsec2005dc/schedule.html Overview of Application Security Tools] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2005'''&lt;br /&gt;
&lt;br /&gt;
Patrick Hynds, CTO: Critical Sites - [http://www.owasp.org/docroot/owasp/misc/Passwords-Keys_to_the_Kingdom_Dev_V1.ppt Passwords - Keys to the Kingdom] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2005'''&lt;br /&gt;
&lt;br /&gt;
Jonathan Levin - [http://www.owasp.org/docroot/owasp/misc/JLevinRandoms.pdf Of Random Numbers] &lt;br /&gt;
&lt;br /&gt;
Jothy Rosenberg, Founder and CTO: Service Integrity - [http://www.owasp.org/docroot/owasp/misc/JothyRWebSvcsSec.ppt Web Services Security] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2005'''&lt;br /&gt;
&lt;br /&gt;
Joe Stagner: Microsoft Let's talk about Application Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Feb 2005'''&lt;br /&gt;
&lt;br /&gt;
Application Security Inc. PowerPoint slides for the [http://www.owasp.org/docroot/owasp/misc/Anatomy+of+an+Attack.ppt Anatomy of a Database Attack.]&lt;br /&gt;
&lt;br /&gt;
== Local Chapter Information ==&lt;br /&gt;
&lt;br /&gt;
To find out more about the Boston chapter, just join the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. &lt;br /&gt;
&lt;br /&gt;
The chapter shipping/mailing address is: &lt;br /&gt;
&lt;br /&gt;
OWASP Boston &amp;lt;br /&amp;gt;&lt;br /&gt;
35 Wachusett Dr &amp;lt;br /&amp;gt;&lt;br /&gt;
Lexington, MA 02421 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Reviews_of_security_podcasts Reviews of security podcasts]&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/2017_BASC_Homepage Boston Application Security Conference 2017] &lt;br /&gt;
&lt;br /&gt;
[[2016 BASC Homepage|Boston Application Security Conference 2016]]&lt;br /&gt;
&lt;br /&gt;
[[2015 BASC Homepage|Boston Application Security Conference 2015]]&lt;br /&gt;
&lt;br /&gt;
[[2014 BASC Homepage|Boston Application Security Conference 2014]]&lt;br /&gt;
&lt;br /&gt;
[[2013 BASC Homepage|Boston Application Security Conference 2013]]&lt;br /&gt;
&lt;br /&gt;
[[2012 BASC Homepage|Boston Application Security Conference 2012]] &lt;br /&gt;
&lt;br /&gt;
[[2011 BASC Homepage|Boston Application Security Conference 2011]] &lt;br /&gt;
&lt;br /&gt;
[[2010 BASC Homepage|Boston Application Security Conference 2010]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Boston OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
'''Contact'''&lt;br /&gt;
&lt;br /&gt;
* Email the [mailto:boston-leaders@owasp.org chapter leaders].&lt;br /&gt;
&lt;br /&gt;
'''President''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:jim.weiler@owasp.org Jim Weiler] 781 356 0067 &lt;br /&gt;
&lt;br /&gt;
'''Board of Directors''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:lindaleigh.aberdale@owasp.org LindaLeigh Aberdale]&lt;br /&gt;
* [mailto:mark.arnold@owasp.org Mark Arnold] &lt;br /&gt;
* [mailto:tom.conner@owasp.org Tom Conner] &lt;br /&gt;
* [mailto:mike.perez@owasp.org Mike Perez]&lt;br /&gt;
* [mailto:roy.wattanasin@owasp.org Roy Wattanasin]&lt;br /&gt;
* [mailto:pedro.marcano@owasp.org Pedro Marcano]&lt;br /&gt;
* [mailto:Mark.Schlepphorst@owasp.org Mark Schlepphorst] &lt;br /&gt;
* [mailto:Ori.Zigindere@owasp.org Ori Zigindere] &lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
[[Category:Boston]] &lt;br /&gt;
[[Category:OWASP_Chapter]] &lt;br /&gt;
[[Category:Massachusetts]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Boston&amp;diff=251033</id>
		<title>Boston</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Boston&amp;diff=251033"/>
				<updated>2019-05-04T03:27:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Chapter Meetings --- Our Fifteenth Year */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Boston|extra=Follow @OWASPBOSTON on Twitter. The chapter leader is [mailto:boston@owasp.org Jim Weiler]. The Boston chapter is grateful for support from Constant Contact, Salesforce, Microsoft and Akamai for generously hosting space and their hospitality for various events.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
The Chapter would also like to thank our sponsors for their generous support.|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Boston|emailarchives=http://lists.owasp.org/pipermail/owasp-Boston}}&lt;br /&gt;
&lt;br /&gt;
== Chapter Sponsor ==&lt;br /&gt;
[[File:SIlogostacked.png|Security Innovation|https://www.securityinnovation.com/]]&lt;br /&gt;
&lt;br /&gt;
[[File:Veracode logo.png|Veracode|https://www.veracode.com/]]&lt;br /&gt;
&lt;br /&gt;
== Boston Application Security Conference ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Boston-Banner-468x60.gif|link=2018_BASC_Homepage]] [[Image:twitter_32.png|link=https://twitter.com/@BASConf]] BASC 2019, the Boston Application Security Conference will take place 8:30am to 6:30pm on Saturday, October 19th at Microsoft, 5 Wayside Road, Burlington, MA.  [[2018 BASC Homepage|Read more]]&lt;br /&gt;
&lt;br /&gt;
== Chapter Meetings --- Our Fifteenth Year ==&lt;br /&gt;
&lt;br /&gt;
We now use [http://www.meetup.com/owaspboston/ meetup] to organize meetings.&lt;br /&gt;
&lt;br /&gt;
We meet whenever a speaker and a venue have available dates,  6:30 to 9 pm. &lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to come to any meeting, there is no signup or joining criteria, just come if it sounds interesting. You can join the OWASP Boston Google group. This list is very low volume (2 - 3 emails/month); it is used to remind people about each monthly meeting, inform about local application security events and special chapter offers. &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Information for meeting updates about this and other Boston area user groups can also be found at [http://bug.bostonusergroups.org/Lists/Groups%20Calendar/calendar.aspx BostonUserGroups]. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upcoming Meetings&lt;br /&gt;
&lt;br /&gt;
CMD+CTRL  Web Application Hacking Cyber Range  May 22, 2019 @ 6:00-9:00pm  Athena Health Watertown&lt;br /&gt;
&lt;br /&gt;
Want to test your skills in identifying web app vulnerabilities?  Join OWASP Boston, Athena Health and Security Innovation as members compete in CMD+CTRL, a web application cyber range where players exploit their way through hundreds of vulnerabilities that lurk in business applications today.  Success means learning quickly that attack and defense is all about thinking on your feet. Standard capture the flag using network and operating attack skills will not be much use here; understanding the OWASP Top 10 risks will help you find the vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
For each vulnerability you uncover, you are awarded points. Climb the interactive leaderboard for a chance to win prizes! CMD+CTRL is ideal for development teams to train and develop skills, but anyone involved in keeping your organization’s data secure can play - from developers and managers and even CISOs.&lt;br /&gt;
&lt;br /&gt;
YOU CAN ONLY REGISTER ON THE SECURITY INNOVATION REGISTRATION SITE AT THIS LINK - &amp;lt;nowiki&amp;gt;https://web.securityinnovation.com/athenahealth2019&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Register early to reserve your spot !&lt;br /&gt;
&lt;br /&gt;
Just bring a laptop. Pizza and soda will be provided.&lt;br /&gt;
&lt;br /&gt;
Venue/Location of the event:&lt;br /&gt;
&lt;br /&gt;
Athena Health&lt;br /&gt;
&lt;br /&gt;
311 Arsenal St.&lt;br /&gt;
&lt;br /&gt;
Watertown, MA 02472&lt;br /&gt;
&lt;br /&gt;
See the attached map -&lt;br /&gt;
&lt;br /&gt;
Park in only P2 visitor lot or in garages P1 and P3. Parking is free.&lt;br /&gt;
&lt;br /&gt;
The main lobby door is at “S1” shuttle pickup icon.&lt;br /&gt;
&lt;br /&gt;
Enter the lobby and sign in at the front desk to pick up credentials.&lt;br /&gt;
&lt;br /&gt;
Directions to the event room will be provided at that time&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Training ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Past Meetings ===&lt;br /&gt;
&lt;br /&gt;
''January 29th, 2019'' - Cambridge [https://web.securityinnovation.com/owaspboston2019 Partnered with Security Innovation]&lt;br /&gt;
&lt;br /&gt;
Location: [https://goo.gl/maps/w11GUuJJAbo Quick Base office]&lt;br /&gt;
&lt;br /&gt;
5PM- '''Just bring your computer and evil inner-doer and you are ready to roll!'''&lt;br /&gt;
&lt;br /&gt;
Security Innovation is teaming up with OWASP Boston to offer attendees a fun &amp;quot;find the vulnerabilities&amp;quot; game - CMD+CTRL Cyber Range - that shows how hackers break into websites and teaches the importance of secure coding habits.  &lt;br /&gt;
&lt;br /&gt;
The CMD+CTRL Cyber Range we will be using is called ShadowBank, a banking website where players compete to find vulnerabilities, score points, and move up the leaderboard.  Leveraging cheat sheets, attack tables, and expert led training sessions, platers take their shot at stealing money, manipulating share prices, and conducting other nefarious acts.&lt;br /&gt;
  &lt;br /&gt;
 ''June 14th, 2017'' - Burlington [https://www.meetup.com/owaspboston/events/240033562/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
7:00 pm  ''' Is RASP Ready?'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection is overhyped, according to many analysts and pundits. RASP promises applications that protect themselves - which sounds impossible - how can an application possibly protect itself? An agent that sits inside the app sounds like a deployment nightmare at worst, and a drain on the app at best. What’s the reality? Where are we now and what have we learned? &lt;br /&gt;
&lt;br /&gt;
We’ve seen deployment successes and failures, and we will draw from those specific experiences to describe: &lt;br /&gt;
Where does RASP work? &lt;br /&gt;
* What applications are well-suited for RASP? &lt;br /&gt;
* What types (organizational structure, culture, or skillset) of organizations are well-suited for RASP?&lt;br /&gt;
&lt;br /&gt;
What is the reality of RASP? &lt;br /&gt;
* Is RASP a deployment model or a feature set? &lt;br /&gt;
* How mature is RASP? Is it an over-hyped immature space, enterprise-ready, or somewhere in between? &lt;br /&gt;
* Which RASP capabilities do organizations use? And how do they validate those capabilities in their own environments? &lt;br /&gt;
* Can RASP replace the WAF?&lt;br /&gt;
&lt;br /&gt;
We will conclude, not with a sales pitch, but some lessons learned on: the three must have attributes for RASP, some suggestions on good candidates for RASP – both types of teams and types of applications, and finally - if, how, and when to get started. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Michael Feiertag, CEO and Co-Founder, tCell &lt;br /&gt;
Before co-founding tCell at the end of 2014, Michael led a string of successful products – most recently as head of products at Okta, and prior to that, as technology director at Blue Coat. Prior to Blue Coat, Michael held product management, engineering, and sales positions at several start-ups. Michael holds a B.S. from The University of Chicago, and an M.S. from the University of Maryland&lt;br /&gt;
&lt;br /&gt;
 '''May 2, 2017''' - Burlington [https://www.meetup.com/owaspboston/events/239130768/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
6:50 pm  '''Random Number Generation - Lava Lamps, Clouds, New Standards and the IoT - Richard Moulds'''&lt;br /&gt;
&lt;br /&gt;
The SANS Institute recently listed &amp;quot;Weak random number generators&amp;quot; as one of the 7 most dangerous security techniques to watch in 2017. But how do you really know how good your random numbers are? Virtualization and IoT make things worse and new standards are a wake-up call. Random numbers are the basis of security for all cryptography, yet they are often taken for granted. Without entropy, crypto is just math.  &lt;br /&gt;
&lt;br /&gt;
Learn why random numbers are so hard to generate and validate, compare different technologies in use today across virtualized environments, and discuss operational steps to take the risk out of random numbers and help secure cryptosystems even into the era of quantum computers. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Richard Moulds, General Manager of Whitewood Security, has spoken at RSA 2017 and at several OWASP chapter events in New York, Chicago and Austin. Richard has over 20 years of experience in the area of cryptography and encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2, 2016''' - Cambridge [https://www.meetup.com/owaspboston/events/234648485/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 90 Broadway, Cambridge, MA 02142 (down the street from the usual location)&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
7:00 '&amp;lt;nowiki/&amp;gt;''Advanced Persistent Legal Threats''' - '''''&amp;lt;nowiki/&amp;gt;'''William Gamble, JD, LLM, EMBA'''&lt;br /&gt;
&lt;br /&gt;
Abstract: Good cyber security can protect IT infrastructure against many attacks. Because of the difficulty in monetizing cyber thefts, the direct loss of a breach can be limited. However, the legal costs, both from government agencies and plaintiffs, can be far greater. The legal landscape, both in the US and internationally is changing as fast if not faster than the technology.&lt;br /&gt;
&lt;br /&gt;
Bio: I am a lawyer and a member of the Florida Bar.I used to practice tax, securities and banking law. I have written three books and spoken around the world on the economic efficiency of legal and regulatory infrastructures specifically in emerging markets like China. Over the past two years, I have immersed myself in cyber security. I now hold the CompTIA A+, Network+, and Security+. I will take the CASP next month. Besides keeping up with the regulations, I am studying incident response and auditing. I am also working toward my health care law certification. My hero is Dr. Johannes Ullrich.&lt;br /&gt;
&lt;br /&gt;
 '''September 28, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/233921522/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
6:15 '''OWASP Top 10 #1 - Injection Flaws'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss XML External Entity Injection flaws; how it works, how to prevent, code examples.&lt;br /&gt;
&lt;br /&gt;
6:45 '&amp;lt;nowiki/&amp;gt;''From the Frontlines of RASP Adoption''' - '''''&amp;lt;nowiki/&amp;gt;'''Goran Begic, VP of Product, IMMUNIO'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection (RASP) is one of the newest technologies coined by Gartner and it is in early stages of adoption in the industry. It promises dynamic defense and automatic mitigation of vulnerabilities in web applications.&lt;br /&gt;
&lt;br /&gt;
This presentation is a summary of experiences from several dozens of commercial evaluations and early adoptions in production that took place this year and provides some examples of situations and challenges that are not specific to any individual vendor. In this talk Goran will provide an overview of buying criteria and evaluation requirements across different industries and some typical pitfalls that can slow down adoption.&lt;br /&gt;
&lt;br /&gt;
After the introduction and a brief reminder on the technology Goran will invite audience to participate in discussion about organizational requirements for adoption and operationalization of RASP. &lt;br /&gt;
&lt;br /&gt;
Questions for discussion: &lt;br /&gt;
&lt;br /&gt;
My application is under attack. &lt;br /&gt;
*What actions should I take? &lt;br /&gt;
*Who owns the response? &lt;br /&gt;
*Which attacks should I respond to and which ones can I ignore?&lt;br /&gt;
*How to get started with mitigation provided by technology? &lt;br /&gt;
*Does RASP fit with DevOps? &lt;br /&gt;
*Does RASP help with remediation? &lt;br /&gt;
&lt;br /&gt;
What this presentation is not: This is not a product pitch in any way. Evaluation criteria, comparison of RASP with IAST and other security technologies, personal experiences and examples discussed in this talk are generally applicable to all RASP solutions. &lt;br /&gt;
&lt;br /&gt;
Key takeaways:&lt;br /&gt;
&lt;br /&gt;
At the end of the presentation you will: &lt;br /&gt;
*get a better understanding of requirements for evaluation of RASP and its use cases, &lt;br /&gt;
*if you can pull a successful evaluation alone, or if you will need participation of other groups / teams &lt;br /&gt;
*learn about critical criteria for success of RASP in production &lt;br /&gt;
*how this criteria different relative to appsec testing tools.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 7, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Docker Containers and Application Security''' - '''Tsvi Korren'''&lt;br /&gt;
&lt;br /&gt;
Docker containers are transforming the way applications are developed and deployed. Closely tied to DevOps and Continuous Delivery, containers introduce both risks and opportunities to security management in Web applications. This talk will introduce the basic concepts of containers, how companies use them today and how to support this technology while elevating the security posture of your application stacks.&lt;br /&gt;
&lt;br /&gt;
Tsvi Korren, CISSP, has been an enterprise IT professional for 20 years with background in business process consulting in large organizations. Most recently at CA Technologies, he worked across verticals in government, retail, financial institutions and healthcare to implement compliance and security processes, from Identity and Access to Host and Server Controls. Tsvi is currently the director of technical services at Aqua, concentrating on building bridges between DevOps and Security.&lt;br /&gt;
&lt;br /&gt;
 '''June 8, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/230842887/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6-6:30 '''News, announcements, job postings, etc. '''&lt;br /&gt;
&lt;br /&gt;
6:30-7 '''Introduction to SQL Injection - Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Computer Science Curricula’s Failure - What Should We Do Now?''' - '''Ming Chow &amp;amp; Roy Wattanasin'''&lt;br /&gt;
&lt;br /&gt;
We are still facing the same security vulnerabilities from over a decade ago. The problems are not going away anytime soon and a reason is because Computer Science curricula are still churning out students who are not even exposed to security. This talk will address the lack of emphasis on information security in Computer Science curricula, how CS curricula have an obligation, how to gradually fix the problem by integrating security into many Computer Science undergraduate and graduate classes, and success stories from students. This talk will also discuss what Tufts and Brandeis are currently working on to further address the security education problem by creating a joint cyber security and policy program that spans multiple departments. Additional points and feedback from the audience are encouraged to help with the issue. All are encourage to attend to submit your feedback to help!&lt;br /&gt;
&lt;br /&gt;
Presenters: &lt;br /&gt;
&lt;br /&gt;
Ming Chow - @0xmchow &lt;br /&gt;
&lt;br /&gt;
Ming Chow is a Senior Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He was a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World, DEF CON, Intel, SOURCE Conference, and BSides Boston. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2014 and 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin - @wr0 &lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin is an adjunct faculty at Brandeis University in both the Health and Medical Informatics and Information Security graduate programs. He spends most of his time leading, teaching and developing information security programs, finding vulnerabilities, performing incident response and working on many projects. Roy has spoken at many conferences including RSA, ISSA International, Source Conference, Braintank, Cyber Security World, OWASP and the Security BSides conferences. He is also a healthcare information security professional. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2015. &lt;br /&gt;
&lt;br /&gt;
 '''May 4, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229788205/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Slightly different [http://www.akamai.com/html/about/locations.html Akamai] location: 90 Broadway, Cambridge, MA 02142 between Meadhall and the Mariott&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZAP''' - '''Dan Cornell'''&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons to use source code to assist in web application penetration testing such as making better use of penetration testers’ time, providing penetration testers with deeper insight into system behavior, and highlighting specific sections of so development teams can remediate vulnerabilities faster. Examples of these are provided using the open source ThreadFix plugin for the OWASP ZAP proxy and dynamic application security testing tool. These show opportunities attendees have to enhance their own penetration tests given access to source code.&lt;br /&gt;
&lt;br /&gt;
This presentation covers the “ABCs” of source code assisted web application penetration testing: covering issues of attack surface enumeration, backdoor identification, and configuration issue discovery. Having access to the source lets an attacker enumerate all of the URLs and parameters an application exposes – essentially its attack surface. Knowing these allows pen testers greater application coverage during testing. In addition, access to source code can help to identify potential backdoors that have been intentionally added to the system. Comparing the results of blind spidering to a full attack surface model can identify items of interest such as hidden admin consoles or secret backdoor parameters. Finally, the presentation examines how access to source code can help identify configuration settings that may have an adverse impact on the security of the deployed application.&lt;br /&gt;
&lt;br /&gt;
Dan Cornell is a globally recognized application security expert, Dan Cornell holds over 15 years of experience architecting, developing and securing web-based software systems. As the Chief Technology Officer and a Principal at Denim Group, Ltd., he leads the technology team to help Fortune 500 companies and government organizations integrate security throughout the development process. He is also the original creator of ThreadFix, Denim Group's industry leading application security program management platform. Cornell was Principal Investigator as Denim Group researched and developed the Hybrid Analysis Mapping (HAM) technology that lies at the heart of ThreadFix, through a Small Business Innovation Research (SBIR) contract with the Department of Homeland Security's Science and Technology Directorate.&lt;br /&gt;
&lt;br /&gt;
More information at: http://www.denimgroup.com/about_team_dan.html&lt;br /&gt;
&lt;br /&gt;
 '''April 6, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Runtime Application Self-Protection (RASP) Tools''' - '''Kunal Anand'''&lt;br /&gt;
&lt;br /&gt;
This talk will highlight the latest in AppSec and dive into a different kind of solution called Runtime Application Self-Protection (RASP). We'll also explore a new methodology called language theoretic security (LANGSEC) and explain how it can outperform existing approaches like pattern matching, regular expressions, etc. This talk will lay the foundation via informal and formal theory how lexers, tokenizers and parsers work. We’ll move onto constructing an open source toolchain to analyzing data and exploring interactive data visualizations. Along the way, we’ll cover performance tradeoffs and discuss the challenges of modern application security.&lt;br /&gt;
&lt;br /&gt;
Kunal Anand is the co-founder and CTO of Prevoty, a runtime application security platform. Prior to that, he was the Director of Technology at the BBC Worldwide, overseeing engineering and operations across the company’s global Digital Entertainment and Gaming initiatives. Kunal also has several years of experience leading security, data and engineering at Gravity, MySpace and NASA’s JetPropulsion Laboratory. His work has been featured in Wired Magazine and Fast Company. Kunal received a B.S. from Babson College.&lt;br /&gt;
&lt;br /&gt;
=== Past Training ===&lt;br /&gt;
&lt;br /&gt;
 '''March 16, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/229156529/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Demandware, Burlington.&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
6:30 '''Software Security by the Numbers''' - '''Chris Eng'''&lt;br /&gt;
&lt;br /&gt;
Deep dive into data we’ve collected about the state of software security in 2016 &lt;br /&gt;
* Based on scans of 200,000+ applications over an 18-month period &lt;br /&gt;
* How different industries and programming languages compare to one another &lt;br /&gt;
* Vulnerability remediation habits and patterns &lt;br /&gt;
* Three characteristics of a successful AppSec program &lt;br /&gt;
&lt;br /&gt;
Chris Eng is vice president of research at Veracode. In this role, he leads the team responsible for integrating security expertise into all aspects of Veracode’s technology. Throughout his career, he has led projects breaking, building, and defending web applications and commercial software for some of the world’s largest companies. Chris is a frequent speaker at premier industry conferences, where he has presented on a diverse range of topics, including cryptographic attacks, agile security, mobile application security, and security metrics. He has been interviewed by Bloomberg, Fox Business, CBS, and other media outlets worldwide.&lt;br /&gt;
&lt;br /&gt;
 '''January 26, 2016''' - Waltham - [http://www.meetup.com/owaspboston/events/228202040/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Waltham.  Trapelo Rd. exit from Rt. 128, toward Lincoln. The parking lot entrance is on the right, at the first traffic light. Drive around to the front of the office complex, facing the highway. Enter under the clock tower. Park in the front of the building and enter in the main building lobby, continue down the hallway and you will see the innovation center, enter in the large glass doors. &lt;br /&gt;
&lt;br /&gt;
7:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:20 '''What Security Testing Tools Miss'''&lt;br /&gt;
&lt;br /&gt;
Black Duck Software presents - Static analysis, dynamic analysis, and other testing tools are all essential weapons against adversaries.  But for the 80%+ of companies worldwide that use open source software in their application development these tools are ineffective in identifying and mitigating open source security risks . This presentation will cover:&lt;br /&gt;
&lt;br /&gt;
The value of static and dynamic tools, and where they best fit in the Secure Development Lifecycle          &lt;br /&gt;
&lt;br /&gt;
Why these tools are not useful in identifying known vulnerabilities in open source components          &lt;br /&gt;
&lt;br /&gt;
Controls development and security professionals can deploy to select, detect, manage and monitor open source for existing and newly disclosed vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Food will be provided by Constant Contact.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2015''' - Cambridge - [http://www.meetup.com/owaspboston/events/226394218/ Meetup]&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
Attendee interaction is always mentioned as a high value at meetings and was great at the MetroWest meetings, so we're doing that at Akamai this month. Some discussion starters so far: SSL certificate impacts from CA/Browser alliance decisions and SHA1 weakness; mutual (client) SSL, javascript client and server side; what the heck is threat intelligence, dev ops and faster secure SDLC.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Metrowest&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 20, 7:00 pm&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Innovation Center, Reservoir Place, 1601 Trapelo Road, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
7:00 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:30 '''Access in Maliceland - Risk Based Access Control''' - '''Gunnar Peterson'''&lt;br /&gt;
&lt;br /&gt;
John Lambert observed attackers win because while defenders think in lists, attackers think in graphs. Access control systems divide the system a priori into secure and insecure states. But that’s only worth the paper its printed on. A  Attackers see the system as it is, for attackers, the access control scheme is the beginning of the game not the end. Determined attackers seek out access control models and then find holes that they can leverage. Access control systems that purport to protect the system are built on assumptions from which reality diverges. Application security needs a new approach to access control- adding feedback loops for risk based decisions,  fine-grained, dynamic access control. &lt;br /&gt;
&lt;br /&gt;
Security is a business with a very long list of issues and requirements. The spreadsheets are miles long. This makes it essential to find reusable solution patterns that can address multiple problems.This presentation looks at both medium term improvements and code examples to improve access control decisions and overall security today&lt;br /&gt;
&lt;br /&gt;
Gunnar Peterson ([https://twitter.com/oneraindrop @oneraindrop]) focuses on security architecture consulting and training. Experience includes Associate Editor for IEEE Security &amp;amp; Privacy Journal, a Microsoft MVP for App security, an IANS Research Faculty member, a Securosis Contributing Analyst, and a Visiting Scientist at Carnegie Mellon Software Engineering Institute. He maintains a popular information security blog at http://1raindrop.typepad.com.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Cambridge&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 8, 6:30 pm  ''NOTE: It's the second Wednesday this month.''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
 '''June 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Put Down the Megaphone: Effective Security Advocacy Without the Shouting''' - '''Darren Meyer'''&lt;br /&gt;
&lt;br /&gt;
10 years’ experience in the InfoSec community--including work with organizations in many verticals, in sizes ranging from startups to Fortune 50 enterprises, leading Application Security teams, building and delivering security instruction to developers, managers, and InfoSec professionals—has taught me the importance of crafting advocacy for different audiences. In this talk, I share my experiences in learning to be an effective advocate with three key audiences: developers, management, and non-technical staff.&lt;br /&gt;
&lt;br /&gt;
Darren is an Application Security advocate and researcher, technology hobbyist, and maker. He loves to learn, teach, nerd out, and inflict terrible puns on people. His background includes logistics, software development, and an assortment of information security roles including leading AppSec programs and professional security instruction targeting developers, managers, and InfoSec professionals.&lt;br /&gt;
&lt;br /&gt;
 '''May 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How the crowd is discovering critical vulns missed by traditional methods''' - '''Leif Dreizler'''&lt;br /&gt;
&lt;br /&gt;
State of the art security programs are turning to bug bounties to leverage a vast array of skill-sets and knowledge. Learn why these programs work, when to deploy them, and how you can bring these new application security testing capabilities into your own organization. The speaker will discuss real world examples from bug bounties and focus on cases where business logic flaws and high priority vulnerabilities were found ... even with existing security testing processes in place. &lt;br /&gt;
&lt;br /&gt;
Attendees will learn:&lt;br /&gt;
&lt;br /&gt;
Testing methods deployed by our crowd that help them find bugs the scanners miss&lt;br /&gt;
&lt;br /&gt;
Examples of the high quality of bugs our crowd is finding, including P1'sTrends which vulnerability types are found most often and whyWhat is the ROI on the pay for performance modelWhere does the SDLC merge into crowdsourced testing&lt;br /&gt;
&lt;br /&gt;
Leif Dreizler is a Senior Security Engineer at Bugcrowd, the innovator in crowdsourced security testing for the enterprise. Prior to joining Bugcrowd, Leif was a Senior Application Security Engineer at Redspin, performing application security assessments. During his time at Redspin he also served as the Application Team Lead, liaising with clients at the engineering and sales level. He has also made minor contributions to the Firebug project. Leif attended the University of California, Santa Barbara where he studied Computer Science. Leif recently spoke to the NYC Security Meet-up group.&lt;br /&gt;
&lt;br /&gt;
 '''April 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler Will show some actual examples and patterns of SQL Injection attempts&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Are You An Imposter? Me too!''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
Many people in the information security field feel like a fraud, or an imposter. In reality, we often know far more, and are capable of far more than we believe we do. There is so much to know and we constantly hear about the latest groundbreaking research done by others, which makes us feel less important or worthy. Let’s talk about what Imposter Syndrome is, its prevalence, and then we can start to realize just how capable we are and go forward with the confidence in the field.&lt;br /&gt;
&lt;br /&gt;
 '''March 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, March 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Prioritizing Web Application Vulnerabilities – A Hacker’s Perspective''' - '''Nick Silver'''&lt;br /&gt;
&lt;br /&gt;
The best application risk models capture not only the technical risk factors, but also the business context in which an asset lives.  Traditionally, this is done by auditing application owners on an array of questions in order to properly classify the asset and its data – but that takes time which could be better spent elsewhere.  We interviewed dozens of hackers and asked them which vulnerabilities they would look for first depending on the type of attack they wanted to carry out.  We’ll walk through several examples of how to use this data as a shortcut means for prioritizing risk without the need for any pesky audit questionnaires.&lt;br /&gt;
&lt;br /&gt;
Nick Silver is a Senior Solutions Architect with WhiteHat Security.  He is responsible for translating business requirements into technical ones and assisting businesses in implementing web security programs.  Previously, Nick led a team in WhiteHat’s Threat Research Center where they were responsible for testing more than 2,000 of their customers’ websites for vulnerabilities.  &lt;br /&gt;
&lt;br /&gt;
 '''February 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, announcements''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Incident Response and Web Application Security - Stories from the Trenches''' - '''Fred House and Joe Ceirante'''&lt;br /&gt;
&lt;br /&gt;
Mandiant has conducted numerous incident response engagements throughout its history, including a record number of 200 incidents in 2014. Mandiant consultants Fred House and Joe Ceirante will discuss case studies and trends Mandiant has observed in relation to web application security.&lt;br /&gt;
 &lt;br /&gt;
Topics will include the types of threat actors that target web applications, the techniques they use to compromise web applications, and the activities they perform once inside the network. Techniques for detecting and mitigating web compromises will also be reviewed. All content will be derived from the real-world compromises that Mandiant has investigated.&lt;br /&gt;
&lt;br /&gt;
 '''January 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 7, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, risk analysis of Poodle''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How a Hacker Views Your Web Site''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
''The most popular presentation of BASC 2014''&lt;br /&gt;
&lt;br /&gt;
As defenders, we have to be right 100% of the time where an attacker only needs to be right once. The attack surface of a modern web site is incredibly large and we need to be aware of all of it. Additionally, individual attacks may not always be effective but sometimes using them together can gain the desired effect. In this talk, we’ll take a look at the whole attack surface for a typical web site and the various ways that an attacker will use to compromise a site.&lt;br /&gt;
&lt;br /&gt;
 '''December 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, December 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News and Views You Can Use and Abuse''' - '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
* Some thoughts and analysis on some current app security news and other stuff&lt;br /&gt;
* Adobe password breach&lt;br /&gt;
* Reducing Web Application Firewall SQL injection false positives&lt;br /&gt;
 &lt;br /&gt;
7:15 '''Swift and Security''' - '''Ming Chow'''&lt;br /&gt;
 &lt;br /&gt;
Apple is pushing its new programming language Swift for iOS development and for many good reasons.  This talk will discuss what the language has right in terms of security, the old and new security pitfalls, and what developers need to be aware of moving forward with using the new language.  The fact to the matter is, iOS isn't going away, iOS developers will need to learn and use Swift, and there will be a big rush of Swift-based apps: we might as well learn how to do it right the first time around.&lt;br /&gt;
 &lt;br /&gt;
Ming Chow is an Instructor at the Department of Computer Science, Tufts University. Ten years of web development experience.&lt;br /&gt;
Specialties: Web and Mobile Development, Web and Mobile Security&lt;br /&gt;
&lt;br /&gt;
 '''July 2014'''&lt;br /&gt;
&lt;br /&gt;
Topics: '''Grails Security''' and '''Validating Cross-Site Scripting Vulns with xssValidator'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Cyrus Malekpour''' and '''John Poulin'''&lt;br /&gt;
&lt;br /&gt;
When: Tuesday, July 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic 1: ''Grails Security''&lt;br /&gt;
&lt;br /&gt;
Grails is a framework developed for Groovy in the vein of Rails for Ruby. It provides a lot of features for web app security, but does it do enough? What might you need to implement yourself, and what might be provided? This presentation will discuss tips on securing Grails applications, including tools that the framework provides by default for security. It'll also discuss several shortcomings in the current toolset, and how you can avoid them.&lt;br /&gt;
 &lt;br /&gt;
Cyrus Malekpour (@cmalekpour) is currently interning at nVisium, working on web app development and security. He's currently an undergraduate student at the University of Virginia, where he's studying computer science with an emphasis on security and backend development. &lt;br /&gt;
 &lt;br /&gt;
Topic 2: ''Validating Cross-Site Scripting Vulns with xssValidator''&lt;br /&gt;
 &lt;br /&gt;
xssValidator is a tool developed to automate the testing and validation of Cross-Site Scripting (xss) vulnerabilities within web applications. Automated scanners tend to report large amounts of false-positives, and as consultants we're forced spending our time trying to verify these findings. xssValidator leverages scriptable web-browsers such as PhantomJS and Slimer.js to automatically validate these findings.&lt;br /&gt;
 &lt;br /&gt;
John Poulin is an application security consultant for nVisium who specializes in web application security. He worked previously as a web developer and software engineer that focused on building multi-tier web applications. When he's not hacking on web apps, John spends his time building tools to help him hack on web apps! You can find him on twitter: @forced_request and on myspace: REDACTED.&lt;br /&gt;
&lt;br /&gt;
 '''June 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection and the OWASP Zed Attack Proxy (ZAP)'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Rob Cheyne and Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 - general networking, news discussion, announcements.&lt;br /&gt;
&lt;br /&gt;
7:00 - main presentations&lt;br /&gt;
&lt;br /&gt;
The June 4th meeting will be the second in our series of 2014 training meetings. Rob Cheyne will continue explaining and exploring SQL Injection by conducting an actual injection attack.&lt;br /&gt;
&lt;br /&gt;
This will be a demo-based discussion to get into the mindset of an attacker, and show how an attacker goes after a site. Demo will include: &lt;br /&gt;
&lt;br /&gt;
* BurpProxy demo &lt;br /&gt;
* Common authentication flaws &lt;br /&gt;
* SQL Injection Demo that shows the process and how it builds to a full compromise&lt;br /&gt;
&lt;br /&gt;
'''Rob Cheyne''' is currently CEO of Big Brain Security. In addition to security consulting for Fortune 500 customers, he was the author of LC4, a version of the award-winning L0phtCrack password auditing tool, and he also worked on the code scanning technology that was eventually spun off as Veracode. Rob was at @stake from the very first customer all the way through to the $50M acquisition by Symantec.&lt;br /&gt;
&lt;br /&gt;
'''Jim Weiler''' will introduce the OWASP Zed Attack Proxy (ZAP). This is a very powerful free OWASP intercepting proxy that lets you see, analyze, change, replay etc. every browser request and response, analyze your session, scan and attack web sites, save the results and run reports. We can't cover all the functionality but we'll show some practical tips and techniques.&lt;br /&gt;
&lt;br /&gt;
Pizza, salad and soda courtesy of Akamai&lt;br /&gt;
&lt;br /&gt;
 '''March 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection, WebGoat, Cross Site Request Forgery'''&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
When: Wednesday, March 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
There will be three training sessions:&lt;br /&gt;
&lt;br /&gt;
One will be on SQL Injection - intro, detection, prevention, scanning and false positives. This is the most serious web application vulnerability.&lt;br /&gt;
&lt;br /&gt;
The second will be on OWASP WebGoat. WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons. You can install and practice with WebGoat in either J2EE or in ASP.NET. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat applications. There are hints and 39 different lesson plans on various vulnerabilities and technologies. We won't cover all of them of course!&lt;br /&gt;
&lt;br /&gt;
The third will be on Cross Site Request Forgery - not a hack really, it's just the way the web works. But it causes apps to do legitimate things that you didn't ask them to do.&lt;br /&gt;
&lt;br /&gt;
Pizza and drinks provided by Akamai.&lt;br /&gt;
&lt;br /&gt;
 '''January 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''JavaScript Verification: From Browsers to Pages'''&lt;br /&gt;
&lt;br /&gt;
Modern web browsers implement a &amp;quot;private browsing&amp;quot; mode that is intended to leave behind no traces of a user's browsing activity on their computer. This feature is in direct tension with support for *extensions*, which let users add third-party functionality into their browser. I will discuss the scope of this problem, present our approach to verifying extensions' compliance with private browsing mode, and sketch our findings on several real, third-party extensions. I will then briefly describe the toolkit underlying our approach, and end with a sketch of a newer project, adapting this approach to the very different-seeming problem of statically catching errors when using the jQuery library.&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
&lt;br /&gt;
Benjamin Lerner has just completed a post-doctoral research position in the PLT group at Brown University, and is now a lecturer at Northeastern University.  His research examines the challenges of analyzing client-side web programming, from the behavior of web pages down through the semantics of the browser.  He received a PhD in Computer Science from the University of Washington in 2011, building a platform to analyze conflicts between browser extensions, and a B.S. in Computer Science and Mathematics from Yale University.&lt;br /&gt;
&lt;br /&gt;
 '''November 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Attacking iOS Applications'''  &lt;br /&gt;
&lt;br /&gt;
Slides: [http://www.slideshare.net/kfosaaen/i-os-gcandpb On slideshare]&lt;br /&gt;
&lt;br /&gt;
This presentation will cover the basics of attacking iOS applications (and their back ends) using a web proxy to intercept, modify, and repeat HTTP/HTTPS requests. (The proxy used during research was Burp; however, any HTTP intercepting proxy such as OWASP ZAP could be used) From setting up the proxy to pulling data from the backend systems, this talk will be a great primer for anyone interested in testing iOS applications at the HTTP protocol level. There will be a short (2 minute) primer on setting up the intercepting proxy, followed by three practical examples showing how to intercept data headed to the phone, how to modify data heading to the application server, and how to pull extra data from application servers to further an attack. All of these examples will focus on native iOS apps (Game Center and Passbook) and/or functionality (Passbook Passes).&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Karl Fosaaen'''&lt;br /&gt;
&lt;br /&gt;
Karl is a senior security consultant at NetSPI. This role has allowed Karl to work in a variety of industries, including financial services, health care, and hardware manufacturing. Karl specializes in network and web application penetration testing. In his spare time, Karl helps out as an OPER at THOTCON and a swag goon at DEF CON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''October 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, October 2, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Abusing NoSQL Databases'''&lt;br /&gt;
&lt;br /&gt;
The days of selecting from a few SQL database options for an application are over. There is now a plethora of NoSQL database options to choose from: some are better than others for certain jobs. There are good reasons why developers are choosing them over traditional SQL databases including performance, scalabiltiy, and ease-of-use. Unfortunately like for many hot techologies, security is largely an afterthought in NoSQL databases. This short but concise presentation will illustrate how poor the quality of security in many NoSQL database systems is. This presentation will not be confined to one particular NoSQL database system. Two sets of security issues will be discussed: those that affect all NoSQL database systems such as defaults, authentication, encryption; and those that affect specific NoSQL database systems such as MongoDB and CouchDB. The ideas that we now have a complicated heterogeneous problem and that defense-in-depth is even more necessary will be stressed. There is a common misconception that SQL injection attacks are eliminated by using a NoSQL database system. While specifically SQL injection is largely eliminated, injection attack vectors have increased thanks to JavaScript and the flexibility of NoSQL databases. This presentation will present and demo new classes of injection attacks. Attendees should be familiar with JavaScript and JSON. &lt;br /&gt;
&lt;br /&gt;
Presenter: '''Ming Chow'''&lt;br /&gt;
&lt;br /&gt;
Ming Chow (@tufts_cs_mchow) is a Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He teaches courses largely in the undergraduate curriculum including the second course in the major sequence, Web Programming, Music Apps on the iPad, and Introduction to Computer Security. He was also a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World (2011 and 2012), DEF CON 19 (2011), the Design Automation Conference (2011), Intel, and the SOURCE Conference (Boston 2013). Ming's projects in information security include building numerous CTF challenges, Internet investigations, HTML5 and JavaScript security, and Android forensics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 2013 - Joint Meeting with [http://www.meetup.com/Boston-cloud-services/ Boston Cloud Services]''' &lt;br /&gt;
&lt;br /&gt;
When: Tuesday, September 10, 6 pm&lt;br /&gt;
&lt;br /&gt;
Location: Microsoft NERD Center ''(not our usual location)''&lt;br /&gt;
&lt;br /&gt;
'''Note: This is a joint meeting. Please register at [http://www.meetup.com/Boston-cloud-services/ the Boston Cloud Services meetup page] if you plan to attend.'''&lt;br /&gt;
&lt;br /&gt;
There will be two presentations at this meeting:&lt;br /&gt;
&lt;br /&gt;
Topic: '''People Centric Security (PCS)'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Nick Stamos'''&lt;br /&gt;
&lt;br /&gt;
People Centric Security (PCS) is a new security model, presented as part of Gartner's Maverick Research 2 year ago. PCS is well suited for Cloud Business/Consumer services such as Dropbox, Google Drive, SkyDrive, etc. PCS enables users to have what they desire, and provides enterprises what they require for data governance and compliance. Nick Stamos co-founded his fourth company, nCrypted Cloud in July of 2012. His past startups include Verdasys, Phase Forward (IPO FY2004, $685M Oracle Acquisition 2010), and Amulet. He studied at Tufts University where he received a BSEE and MSEE.&lt;br /&gt;
&lt;br /&gt;
Topic: '''SSL Certs'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
Practical experiences with issuing and risk assessing SSL certs for enterprise applications on a cloud provider: who creates the CSR, how do you protect the private key on the cloud server, certs on cloud provider managed load balancers vrs 3rd party managed app servers, roles and responsibilities of cloud IT, 3rd party developer IT, enterprise IT and service providers. Jim Weiler is Application Security Architect at Starwoods Hotels and the Chapter Leader of OWASP Boston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July 2013 - Doubleheader!'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 10, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Topic: '''RailsGoat'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Ken Johnson'''&lt;br /&gt;
&lt;br /&gt;
Abstract: While working to secure rails applications in a truly Agile development environment, it became clear that the Rails and Ruby ecosystem needed attention from the security community in the form of free and open training, and the events that have transpired within the last few months have only reinforced that belief. [http://railsgoat.cktricky.com/ RailsGoat] is an attempt to bring attention to both the problems that most frequently occur in Rails as well as the solutions for remediation. To accomplish this, we've built a vulnerable Rails application that aligns with the OWASP Top 10 and can be used as a training tool for Rails-based development shops.&lt;br /&gt;
&lt;br /&gt;
Topic: '''PhoneGap on Android'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Jack Mannino'''&lt;br /&gt;
&lt;br /&gt;
Abstract: PhoneGap is a widely used framework that allows developers to rapidly build cross-platform mobile applications using HTML5, JavaScript, and CSS. Using PhoneGap plugins, developers can call native platform APIs from browser-like applications using JavaScript. This approach introduces vulnerabilities that are not typically as prevalent within native Android applications, warranting a fresh look at the way we view mobile applications. In this presentation, we will take a deep look at the Android implementation of the framework and we will examine the overall attack surface for applications. Real-world examples of vulnerable applications will be demonstrated as well in order to provide context, entertainment, and enjoyment.&lt;br /&gt;
&lt;br /&gt;
About the Speakers:&lt;br /&gt;
&lt;br /&gt;
Ken Johnson is the former Manager of LivingSocial.com's application security team where he built their security program before leaving for his true home as the CTO of nVisium Security, a VA-based application security company. Ken is the primary developer of the Web Exploitation Framework and contributes to other open source application security projects as often as time permits. He has spoken at AppSec DC 2010 and 2012, OWASP NoVA and Phoenix chapters, Northern Virginia Hackers Association (NoVAH) and is a contributor to the Attack Research team.&lt;br /&gt;
&lt;br /&gt;
Jack Mannino is the CEO of nVisium Security, a VA-based application security company. At nVisium, he helps to ensure that large corporations, government agencies, and software startups have the tools they need to build and maintain successful security initiatives. He is an active Android security researcher/tinkerer, and has a keen interest in identifying security issues and trends on a large scale. Jack is a leader and founder of the OWASP Mobile Security Project. He is the lead developer for the OWASP GoatDroid project, and is the chairman of the OWASP Northern Virginia chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''June 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''We see the future…and it isn’t pretty'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Andrea Mulligan, Sr. Director at Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
In this session Andrea presents research findings from the State of Software Security Report, which offers a before the breach look at security by examining the flaws commonly found in applications of all kinds. She will also examine what the research findings mean for security, predict how these flaws could cause history to repeat itself, and discuss how security pros can help change the future. &lt;br /&gt;
&lt;br /&gt;
 '''May 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Systems Thinking + Web Security'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Akamai'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Akamai will present on ‘Systems Thinking + Web Security’. There will also be an audience review exercise facilitated by the Akamai presenters.  This is a great chance to hear some interesting perspectives on web security from Akamai, who handles about one third of all internet traffic.&lt;br /&gt;
&lt;br /&gt;
 '''April 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Go Fast. Be Secure: Effectively Govern the Use of Open Source Components Throughout the SDLC'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Sonotype'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
* Open Source Software (OSS) Component supply chain complexities and realities. Open source is constantly changing and knowing the version in your software, as well as the current version history of the component (how do you show an auditor you are using a current version) is important. &lt;br /&gt;
* Open Source Consumption Patterns from the Central Repository. Which versions are the most popular can tell you which versions are the most stable, useful, secure etc.&lt;br /&gt;
* OWASP Top 10 (A9) - Using Components with Known Vulnerabilities. To decide on the risk of OSS components with vulnerabilities, you need to know the vulnerabilities, their severity and which components they occur in as well as where in the code dependency tree they are. &lt;br /&gt;
* OSS Security, Quality and License policies must be woven into the development process. Knowing the number and type of open source licenses in your software can be important to the legal standing of your code and if it conflicts with any corporate standards. The licensing is also important in order to know the restrictions on changing the software.&lt;br /&gt;
* OSS Component Policy Examples&lt;br /&gt;
* Example Application Compositions Reports&lt;br /&gt;
* Example Use cases IDE, CI, repository, production applications&lt;br /&gt;
* Discussion&lt;br /&gt;
&lt;br /&gt;
About Sonatype:&lt;br /&gt;
&lt;br /&gt;
Sonatype operates the Central Repository, the industry's primary source for open-source components, housing more than 400,000 components and serving more than five billion requests per year from more than 60,000 organizations. The company has been a pioneer in component-based software development since its founding by Jason van Zyl, the creator of the Apache Maven build management system and the Central Repository. &lt;br /&gt;
&lt;br /&gt;
 '''March 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''What is BSIMM?'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Nabil Hannan'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Nabil is Director of Vulnerability Assessments and Managing Consultant at Cigital.&lt;br /&gt;
 &lt;br /&gt;
The purpose of the BSIMM is to quantify the activities carried out by real software security initiatives. BSIMM is a study of the secure development practices of over 50 organizations, analyzed along the dimensions that were found in the data, not along preconceived ideas of what secure development should be.  &lt;br /&gt;
&lt;br /&gt;
BSIMM describes the work of 974 software security group members working with a satellite of 2039 people to secure the software developed by 218,286 developers. &lt;br /&gt;
&lt;br /&gt;
The BSIMM describes 111 activities that any organization can put into practice. The activities are described in twelve practices grouped into four domains. Associated with each activity is an objective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''February 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''BroBot'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Eric Kobrin, Akamai'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Eric Kobrin is a Senior Security Architect in the Infosec organization of Akamai Technologies, the global leader in Cloud-based application acceleration and content delivery. Eric has been involved in Software Architecture for over 15 years, having worked at such companies and IBM, Velocitude and eDiets.com. He has a passion for programming languages, security, and software performance and has worked in all layers of the software stack from hypervisors to complex servers and web applications. Eric's works have been published, presented at international conferences and patented.&lt;br /&gt;
 &lt;br /&gt;
His presentation will provide an analysis of the BroBot DDOS attacks, including discussion of:&lt;br /&gt;
&lt;br /&gt;
* Vulnerable system discovery&lt;br /&gt;
* Zombie compromise&lt;br /&gt;
* Control structure&lt;br /&gt;
* Attack traffic&lt;br /&gt;
* Mitigation steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''January 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Third-Party Application Analysis: Best Practices and Lessons Learned'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Chad Holmes, Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Chad Holmes will present details of the work Veracode has been doing with their 3rd Party program, discuss the technical and business challenges that have arisen during that time and lead a discussion on what team members can do to help drive adoption of security best practices across their vendor community.&lt;br /&gt;
&lt;br /&gt;
The flow of the presentation is designed to drive discussion within an audience – both from a technical and business perspective with some anecdotal stories. Chad wants this to be an interactive discussion so he’ll have questions and you should bring yours I’ve already sent him some.  The order of the presentation is:&lt;br /&gt;
&lt;br /&gt;
·         Adoption rates of externally developed software&lt;br /&gt;
&lt;br /&gt;
·         The risk within those apps&lt;br /&gt;
&lt;br /&gt;
·         Some deeper stats on what “3rd party” really means (total outsourcing/total COTS produced/open source/imported libraries/etc)&lt;br /&gt;
&lt;br /&gt;
·         Some raw data about our experiences (to show this is based on a large sample size rather than “Look how awesome Veracode is!”)&lt;br /&gt;
&lt;br /&gt;
·         Challenges that will be faced (business, intellectual property, policy, analysis capabilities, etc)&lt;br /&gt;
&lt;br /&gt;
·         Best Practices for high rates of adoption&lt;br /&gt;
&lt;br /&gt;
·         Lessons Learned and Recommendations&lt;br /&gt;
&lt;br /&gt;
Chad Holmes has over 10 years of software development and application security experience. During his time at Veracode, Chad has lead the redesign and execution of the third-party analysis process to allow for a more streamlined approach while still addressing common ISV intellectual property concerns. In addition to his third-party analysis responsibilities, Chad's previous work as a Security Program Manager has lead to the successful roll out and improvement of multiple corporate application security groups.&lt;br /&gt;
&lt;br /&gt;
 '''June 2012'''&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker '''Will Vandevanter - Rapid 7'''&lt;br /&gt;
&lt;br /&gt;
'''Fingerprinting web applications of all kinds'''&lt;br /&gt;
&lt;br /&gt;
This turbo talk will introduce a new Metasploit module that fingerprints &amp;quot;known&amp;quot; web applications, attempts the default credentials for the application, and runs an associated exploit or authenticated access module if applicable. Some example fingerprints in the database target common enterprise web applications including Microsoft products (Outlook Web Access, Sharepoint), printers (Xerox Document Centre), security cameras, routers, and others. &lt;br /&gt;
&lt;br /&gt;
Will Vandevanter is a senior penetration tester and researcher at Rapid7. His focus interests include web application security and secure code. He has previously spoken at Defcon, SOURCE, BSides LV, and other conferences. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 '''May 31 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Jobspring, Boston. 545 Boylston st. &lt;br /&gt;
&lt;br /&gt;
Speaker - '''Glenn Gramling, Vice President, Cenzic'''&lt;br /&gt;
&lt;br /&gt;
“Cloudy with a Chance of Hack”&lt;br /&gt;
&lt;br /&gt;
Cloud computing is a cost effective and efficient way for enterprises to automate their processes. However organizations need to be aware of the pitfalls of the many cloud solutions out there - one of the main being security. Most cloud applications were built for ease of use and without security necessarily in mind. Companies need to be asking their solution providers about the security measures used in developing the application and get an independent verification to make sure there are no gaping holes. With over 75% of attacks occurring through the Web, any attack through these applications can lead to leakage of confidential information and embarrassment. In this session, we'll give attendees tips and tricks to prepare them for the potential of &amp;quot;stormy weather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Glenn Gramling is responsible for global sales and business development for Cenzic’s  application security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''April 11, 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker - '''David Eoff, Senior Product Marketing Manager, HP Enterprise Security'''&lt;br /&gt;
&lt;br /&gt;
David is a Senior Product Marketing Manager, within the Enterprise Security Products division of HP focused on Fortify application security. His 18+ years of background in software and hardware enterprise marketing provides a solid foundation for his marketing of the HP security solutions. &lt;br /&gt;
 &lt;br /&gt;
Prior to joining Fortify in 2009 and being acquired by HP, David ran Firewall and IPS marketing for the Security division of Nokia Corporation. In addition, he has held multiple positions in product marketing, product management, channel marketing and sales while working for Oracle, EMC, Legato, BMC Software and several start-ups.&lt;br /&gt;
&lt;br /&gt;
Topic - '''Gray, the New Black:  Gray-Box Vulnerability Testing'''&lt;br /&gt;
&lt;br /&gt;
Over the years, two key techniques have emerged as the most effective for finding security vulnerabilities in software:  Dynamic Application Security Testing (DAST) and Static Application Security Testing (SAST).  While DAST and SAST each possess unique strengths, the “Holy Grail” of security testing is thought to be “hybrid” – a technique that combines and correlates the results from both testing methods, maximizing the advantages of each. Until recently, however, a critical element has been missing from first generation hybrid solutions:  information about the inner workings and behavior of applications undergoing DAST and SAST analysis.&lt;br /&gt;
 &lt;br /&gt;
This presentation will introduce you to the next generation of hybrid security analysis – what it is, how it works, and the benefits it offers.  It will also address (and dispel) the claims against hybrid, and leave you with a clear understanding of how the new generation of hybrid will enable organizations to resolve their most critical software security issues faster and more cost-effectively than any other available analysis technology.&lt;br /&gt;
&lt;br /&gt;
 '''March 8, 2012, with the Boston Security Meetup group'''&lt;br /&gt;
&lt;br /&gt;
Location - [http://maps.google.com/maps?q=Jobspring+Partners,+Boylston+Street,+Boston,+MA&amp;amp;hl=en&amp;amp;sll=42.362243,-71.081628&amp;amp;sspn=0.019549,0.037594&amp;amp;oq=jobspring&amp;amp;t=v&amp;amp;hq=Jobspring+Partners,&amp;amp;hnear=Boylston+St,+Boston,+Massachusetts&amp;amp;z=17 JobSpring, Boylston St.]&lt;br /&gt;
&lt;br /&gt;
Topic - '''Corporate Espionage for Dummies: The Hidden Threat of Embedded Web Servers'''&lt;br /&gt;
&lt;br /&gt;
Speaker - VP for Security Research at ZScaler, along with other speakers at the security meetup.&lt;br /&gt;
 &lt;br /&gt;
Today, everything from kitchen appliances to television sets come with an IP address. Network connectivity for various hardware devices opens up exciting opportunities. Forgot to lower the thermostat before leaving the house? Simply access it online. Need to record a show? Start the DVR with a mobile app. While embedded web servers are now as common as digital displays in hardware devices, sadly, security is not. What if that same convenience exposed photocopied documents online or allowed outsiders to record your telephone conversations? A frightening thought indeed.&lt;br /&gt;
 &lt;br /&gt;
Software vendors have been forced to climb the security learning curve. As independent researchers uncovered embarrassing vulnerabilities, vendors had little choice but to plug the holes and revamp development lifecycles to bake security into products. Vendors of embedded web servers have faced minimal scrutiny and as such are at least a decade behind when it comes to security practices. Today, network connected devices are regularly deployed with virtually no security whatsoever.&lt;br /&gt;
 &lt;br /&gt;
The risk of insecure embedded web servers has been amplified by insecure networking practices. Every home and small business now runs a wireless network, but it was likely set up by someone with virtually no networking expertise. As such, many devices designed only for LAN access are now unintentionally Internet facing and wide open to attack from anyone, regardless of their location.&lt;br /&gt;
 &lt;br /&gt;
Leveraging the power of cloud based services, Zscaler spent several months scanning large portions of the Internet to understand the scope of this threat. Our findings will make any business owner think twice before purchasing a 'wifi enabled' device. We'll share the results of our findings, reveal specific vulnerabilities in a multitude of appliances and discuss how embedded web servers will represent a target rich environment for years to come. &lt;br /&gt;
&lt;br /&gt;
 '''December 13, 2011, 6:30, Microsoft NERD, Cambridge, Horace Mann Room'''&lt;br /&gt;
&lt;br /&gt;
'''Jeremiah Grossman – Founder and CTO WhiteHat Security'''&lt;br /&gt;
 &lt;br /&gt;
Directions: http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx&lt;br /&gt;
&lt;br /&gt;
 '''September 14 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Dinis Cruz   -  OWASP O2 Platform'''&lt;br /&gt;
&lt;br /&gt;
The O2 Platform is focused on automating application security knowledge and workflows. It is a library of scriptable objects specifically designed for developers and security consultants to be able to perform quick, effective and thorough source code-driven application security reviews (blackbox + whitebox). &lt;br /&gt;
&lt;br /&gt;
 '''September 7 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Adriel Desautels –  Differences between Penetration Testing and Vulnerability Scanning'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July  2011'''&lt;br /&gt;
&lt;br /&gt;
'''Anurag Agarwal, the founder of MyAppSecurity'''&lt;br /&gt;
&lt;br /&gt;
'''Session 1 - Managing Risk with Threat Modeling''' &lt;br /&gt;
Threat Modeling can help by guiding the Application Development Teams to ensure your Security Policies get properly coded into the Applications at time of Development.  By creating pre-approved methods of coding for your development teams, and applying them in a repeatable and scalable process, you can assist your development teams in building a secure application easily and effortlessly.&lt;br /&gt;
&lt;br /&gt;
'''Session 2 - False Positive, False Negative and False Sense of Security''' &lt;br /&gt;
This interactive session will talk about the pros and cons of using black box testing tools and discuss their effectiveness in building a mature software security program. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday June 2'''&lt;br /&gt;
&lt;br /&gt;
Location - '''Microsoft NERD''' - http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx &lt;br /&gt;
&lt;br /&gt;
'''Topic - Bringing Sexy Back: Defensive Measures That Actually Work''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Paul Asadoorian, Founder &amp;amp;amp; CEO, PaulDotCom Enterprises &lt;br /&gt;
&lt;br /&gt;
There is a plethora of information available on how to break into systems, steal information, and compromise users. As a penetration tester, I have performed testing on a regular basis that reveals severe security weaknesses in several organizations, and many of my peers have reported on the same. However, once you &amp;quot;own&amp;quot; the network and report on how you accomplished your goals, now what? Sure, we make defensive recommendations, but consistently it has been proven that security can be bypassed. Not enough focus is given to what works defensively. We have a lot of technology at our disposal: firewalls, intrusion detection, log correlation, but it provides little protection from today's threats and is often not implemented effectively. This talk will focus on taking an offensive look at defense. Applying techniques that are simple, yet break the mold of traditional defensive measures. We will explore setting up &amp;quot;traps&amp;quot; for attackers, slowing them down with simple scripts, using honeypots, planting bugs, and most importantly tying these methods to &amp;quot;enterprise security&amp;quot;. This talk will also include real-world examples of the techniques in action from a live, heavily attacked site. Topics will include: &lt;br /&gt;
&lt;br /&gt;
*Using wireless “attacks” on the attackers&lt;br /&gt;
*Implementing the Metasploit Decloak engine to find the attackers&lt;br /&gt;
*Setting traps to detect web application attacks&lt;br /&gt;
*Integrating results into your enterprise log management tool&lt;br /&gt;
&lt;br /&gt;
The goal of this talk is to make defense “sexy”… &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian is currently the &amp;quot;Product Evangelist&amp;quot; for Tenable Network Security, where he showcases vulnerability scanning and management through blogs, podcasts and videos. Paul is also the founder of PaulDotCom, an organization centered around the award winning &amp;quot;PaulDotCom Security Weekly&amp;quot; podcast that brings listeners the latest in security news, vulnerabilities, research and interviews with the security industry's finest. Paul has a background in penetration testing, intrusion detection, and is the co-author of &amp;quot;WRT54G Ultimate Hacking&amp;quot;, a book dedicated to hacking Linksys routers. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday May 26'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
'''Topic - OWASP Top 10 issue #4 – Insecure Direct Object Reference''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels and President of OWASP Boston &lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss threat models, risks and various remediations of issue #4 in the 2010 OWASP Top 10 – Insecure Direct Object References. &lt;br /&gt;
&lt;br /&gt;
'''Topic - A Web-Application Architecture for Regulatory Compliant Cloud Computing''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Arshad Noor, StrongAuth &lt;br /&gt;
&lt;br /&gt;
The emergence of cloud-computing as an alternative deployment strategy for IT systems presents many opportunities, yet challenges traditional notions of data-security. The fact that data-security regulations are developing teeth, leaves information technology professionals perplexed on how to take advantage of cloud-computing while proving compliance to regulations for protecting sensitive information. &lt;br /&gt;
&lt;br /&gt;
This presentation presents an architecture for building the next generation of web-applications. This architecture allows you to leverage emerging technologies such as cloud-computing, cloud-storage and enterprise key-management (EKM) to derive benefits such as lower costs, faster time-to-market and immense scalability with smaller investments - while proving compliance to PCI-DSS, HIPAA/HITECH and similar data-security regulations. &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Arshad Noor is the CTO of StrongAuth, Inc, a Silicon Vally-based company that specializes in enterprise key management. He is the designer and lead-developer of StrongKey, the industry's first open-source Symmetric Key Management System, and the KeyAppliance - the industry's first appliance combining encryption, tokenization, key-management and a cryptographic hardware module at an unprecedented value. He has written many papers and spoken at many forums on the subject of encryption and key-management over the years. &lt;br /&gt;
&lt;br /&gt;
 ''' CANCELLED   ''' &lt;br /&gt;
&lt;br /&gt;
'''Topic – Secure Application design and Coding''' -- CANCELLED &lt;br /&gt;
&lt;br /&gt;
Presenter - Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
'''Speaker Bio ''' &lt;br /&gt;
&lt;br /&gt;
 '''April 2011'''&lt;br /&gt;
&lt;br /&gt;
Ed Adams Security Innovation -- the new OWASP Exams Project and the work being done by the OWASP Academies Working Group &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2011'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
Owning the world, one mobile app at a time, and web services pen testing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Febrary 2011'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO of Safelight Security - &lt;br /&gt;
&lt;br /&gt;
Security Leadership series: Delivering a successful security presentation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2010'''&lt;br /&gt;
&lt;br /&gt;
Application Architecture Security Assessment - Second session &lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2010'''&lt;br /&gt;
&lt;br /&gt;
Open SAMM – Software Assurance Maturity Model &lt;br /&gt;
&lt;br /&gt;
Shakeel Tufail is the Federal Practice Manager at Fortify, an HP company. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors Overview: In this highly interactive two-part workshop, Rob Cheyne of Safelight Security will show you the basics of conducting a real-world architecture &amp;amp;amp; design review. This workshop draws from Safelight's Security Architecture Fundamentals training course, a two-day course frequently used to teach Fortune 500 companies how to look at their system architectures from both the hacker's and the designer’s point of view. &lt;br /&gt;
&lt;br /&gt;
 '''July 2010'''&lt;br /&gt;
&lt;br /&gt;
Lightning Talk – Rob Cheyne, CEO Safelight Security Advisors In this installment of the Safelight lightning talks series, Rob will present the basics of a Cross-site Request Forgery (CSRF). &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Drive-by Pharming with MonkeyFist &lt;br /&gt;
&lt;br /&gt;
Joey Peloquin - Director of Application Security, Fishnet Security &lt;br /&gt;
&lt;br /&gt;
 '''June 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - topic to be announced &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Ryan Barnett The Web Hacking Incident Database (WHID) is a Web Application Security Consortium project dedicated to maintaining a list of web applications related security incidents. Ryan Barnett is director of application security research at Breach Security where he leads Breach Security Labs. &lt;br /&gt;
&lt;br /&gt;
 '''May 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - SQL Injection &lt;br /&gt;
&lt;br /&gt;
Vinnie Liu - Data Exposure, New Approaches to Open Source Intelligence Techniques, and Incident Handling &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2010'''&lt;br /&gt;
&lt;br /&gt;
Dan Hestad Security Innovation Dan will be talking about his experiences with PCI and web applications, and answering questions about do's and don'ts of acceptable PCI practices in web applications. &lt;br /&gt;
&lt;br /&gt;
 '''March 2010'''&lt;br /&gt;
&lt;br /&gt;
Zack Lanier - Disclosure Samsara, or &amp;quot;the endless vulnerability disclosure debate&amp;quot; &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.html &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.pdf (very large PDF) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne of Safelight Security Advisors; New Technology, Same Old Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2010 at Microsoft NERD, Cambridge'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 Technologies &lt;br /&gt;
&lt;br /&gt;
 '''December 2009'''&lt;br /&gt;
&lt;br /&gt;
Eric Bender, Cenzic &lt;br /&gt;
&lt;br /&gt;
 '''November 2009'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels - Web Application Vulnerability Scanners &lt;br /&gt;
&lt;br /&gt;
Mush Hakhinian, Leader, Application Security Practice, IntraLinks - Secure coding with no money down using SONAR: unleashing the power of open-source code analysis tools &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2009'''&lt;br /&gt;
&lt;br /&gt;
Paul Schofield, Senior Security Engineer, Imperva - From Rivals to BFF: WAF &amp;amp;amp; VA Unite &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2009 at CORE Technologies, Boston'''&lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian, Pauldotcom.com &lt;br /&gt;
&lt;br /&gt;
Alex Horan, CORE Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2009'''&lt;br /&gt;
&lt;br /&gt;
Joey Peloquin, Fishnet Security, Secure SDLC: The Good, the Bad and the Ugly [http://www.owasp.org/images/4/48/SecureSDLC-GoodBadUgly.pdf presentation pdf] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2009'''&lt;br /&gt;
&lt;br /&gt;
Sabha Kazerooni, Security Compass - Exploit Me tools; Framework Level Threat Analysis &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5a/Security_Compass_Exploilt_Me.pdf ExploitMe Document] &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/e/ef/Security_Compass_Framework-level_Threat_Analysis.pdf Framework Level Threat Analysis document] &lt;br /&gt;
&lt;br /&gt;
Meeting Pizza Sponsor - Arcot &lt;br /&gt;
&lt;br /&gt;
Arcot is a leader in online fraud prevention, strong authentication and eDocument security. Arcot's solutions are easily deployed, low-cost and extremely scalable, allowing organizations to transparently protect their users from fraud without changing user behavior or requiring expensive hardware. &lt;br /&gt;
&lt;br /&gt;
Arcot can be contacted thru Michael Kreppein, michael.kreppein@arcot.com, 617-467-5200 &lt;br /&gt;
&lt;br /&gt;
 '''December 2008'''&lt;br /&gt;
&lt;br /&gt;
Brian Holyfield, Gothem Digital Science &lt;br /&gt;
&lt;br /&gt;
Tamper Proofing Web Applications http://www.gdssecurity.com/l/b/2008/12/04/ &lt;br /&gt;
&lt;br /&gt;
 '''June 2008'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman; Founder and CTO, Whitehat Security &lt;br /&gt;
&lt;br /&gt;
Appetizer - Hacking Intranets from the Outside (Just when you thought your network was safe) Port scanning with JavaScript &lt;br /&gt;
&lt;br /&gt;
Main Topic - Business Logic Flaws: How they put your Websites at Risk &lt;br /&gt;
&lt;br /&gt;
 '''March 2008'''&lt;br /&gt;
&lt;br /&gt;
Chris Eng; Senior Director, Security Research, Veracode &lt;br /&gt;
&lt;br /&gt;
Description – Attacking crypto in web applications &lt;br /&gt;
&lt;br /&gt;
 '''December 2007'''&lt;br /&gt;
&lt;br /&gt;
Scott Matsumoto; Principal Consultant, Cigital &lt;br /&gt;
&lt;br /&gt;
Description – You Say Tomayto and I Say Tomahto – Talking to Developers about Application Security &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/5/5b/BostonOWASP200712-Cigital.pdf Cigital Presentation] &lt;br /&gt;
&lt;br /&gt;
 '''November 2007'''&lt;br /&gt;
&lt;br /&gt;
Tom Mulvehill Ounce Labs &lt;br /&gt;
&lt;br /&gt;
Description – Tom will share his knowledge and expertise on implementing security into the software development life cycle. This presentation will cover how to bring practicality into secure software development. Several integration models will be explored as well as solutions for potential obstacles &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/f/f8/Ounce_OWASP_07NOV07ppt.zip Ounce presentation] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2007'''&lt;br /&gt;
&lt;br /&gt;
George Johnson, Principal Software Engineer EMC; CISSP &lt;br /&gt;
&lt;br /&gt;
An Introduction to Threat Modeling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2007'''&lt;br /&gt;
&lt;br /&gt;
Day of Worldwide OWASP 1 day conferences on the topic &amp;quot;Privacy in the 21st Century&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 '''June 2007'''&lt;br /&gt;
&lt;br /&gt;
Tool Talk - Jim Weiler - WebGoat and Crosssite Request Forgeries &lt;br /&gt;
&lt;br /&gt;
Danny Allan; Director, Security Research, Watchfire &lt;br /&gt;
&lt;br /&gt;
Topic: Exploitation of the OWASP Top 10: Attacks and Strategies &lt;br /&gt;
&lt;br /&gt;
 '''March 2007'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman, CTO Whitehat Security: Top 10 Web Application Hacks of 2006 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2007'''&lt;br /&gt;
&lt;br /&gt;
Dave Low, RSA the Security Division of EMC: encryption case studies &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2006'''&lt;br /&gt;
&lt;br /&gt;
Mike Gavin, Forrester Research: Web Application Firewalls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''June 2006'''&lt;br /&gt;
&lt;br /&gt;
Imperva - Application and Database Vulnerabilities and Intrusion Prevention &lt;br /&gt;
&lt;br /&gt;
Jim Weiler - Using Paros Proxy Server as a Web Application Vulnerability tool &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2006'''&lt;br /&gt;
&lt;br /&gt;
Dennis Hurst; SPI Dynamics: A study of AJAX Hacking &lt;br /&gt;
&lt;br /&gt;
Jim Weiler; OWASP Boston: Using Paros HTTP proxy, part 1. first meeting with all demos, no powerpoints! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2006'''&lt;br /&gt;
&lt;br /&gt;
Mateo Meucci; OWASP Italy [http://www.owasp.org/images/8/8c/Anatomy_of_2_Web_App_Testing.zip Anatomy of 2 web attacks] &lt;br /&gt;
&lt;br /&gt;
Tom Stracener; Cenzic Web Application Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2006'''&lt;br /&gt;
&lt;br /&gt;
Ron Ben Natan; Guardium CTO Database Security: Protecting Identity Information at the Source &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2006'''&lt;br /&gt;
&lt;br /&gt;
David Low, Senior Field Engineer: RSA Practical Encryption &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2005'''&lt;br /&gt;
&lt;br /&gt;
Paul Galwas, Product Manager: nCipher [http://www.owasp.org/docroot/owasp/misc/OWASP051207.ppt Enigma variations: Key Management controlled] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2005'''&lt;br /&gt;
&lt;br /&gt;
Robert Hurlbut, Independent Consultant [http://www.owasp.org/docroot/owasp/misc/OWASP_Hurlbut_ThreatModelingforWebApplicaitons.zip Threat Modeling for web applications] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2005'''&lt;br /&gt;
&lt;br /&gt;
Prateek Mishra, Ph.D. Director, Security Standards and Strategy: Oracle Corp Chaiman of the OASIS Security Services (SAML) Technical Committee - [http://www.owasp.org/docroot/owasp/misc/Federation-Introduction-Overview-01.ppt Identity Federation&amp;amp;nbsp;: Prospects and Challenges] &lt;br /&gt;
&lt;br /&gt;
Ryan Shorter, Sr. System Engineer: Netcontinuum - Application Security Gateways &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2005'''&lt;br /&gt;
&lt;br /&gt;
Dr. Herbert Thompson, Chief Security Strategist: SecurityInnovation - How to Break Software Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''July 2005'''&lt;br /&gt;
&lt;br /&gt;
Mark O'Neill, CTO: Vordel - [http://www.owasp.org/docroot/owasp/misc/MarkOneill.pdf Giving SOAP a REST? A look at the intersection of Web Application Security and Web Services Security] &lt;br /&gt;
&lt;br /&gt;
 '''June 2005'''&lt;br /&gt;
&lt;br /&gt;
Arian Evans, National Practice Lead, Senior Security Engineer: Fishnet Security [http://www.owasp.org/conferences/appsec2005dc/schedule.html Overview of Application Security Tools] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2005'''&lt;br /&gt;
&lt;br /&gt;
Patrick Hynds, CTO: Critical Sites - [http://www.owasp.org/docroot/owasp/misc/Passwords-Keys_to_the_Kingdom_Dev_V1.ppt Passwords - Keys to the Kingdom] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2005'''&lt;br /&gt;
&lt;br /&gt;
Jonathan Levin - [http://www.owasp.org/docroot/owasp/misc/JLevinRandoms.pdf Of Random Numbers] &lt;br /&gt;
&lt;br /&gt;
Jothy Rosenberg, Founder and CTO: Service Integrity - [http://www.owasp.org/docroot/owasp/misc/JothyRWebSvcsSec.ppt Web Services Security] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2005'''&lt;br /&gt;
&lt;br /&gt;
Joe Stagner: Microsoft Let's talk about Application Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Feb 2005'''&lt;br /&gt;
&lt;br /&gt;
Application Security Inc. PowerPoint slides for the [http://www.owasp.org/docroot/owasp/misc/Anatomy+of+an+Attack.ppt Anatomy of a Database Attack.]&lt;br /&gt;
&lt;br /&gt;
== Local Chapter Information ==&lt;br /&gt;
&lt;br /&gt;
To find out more about the Boston chapter, just join the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. &lt;br /&gt;
&lt;br /&gt;
The chapter shipping/mailing address is: &lt;br /&gt;
&lt;br /&gt;
OWASP Boston &amp;lt;br /&amp;gt;&lt;br /&gt;
35 Wachusett Dr &amp;lt;br /&amp;gt;&lt;br /&gt;
Lexington, MA 02421 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Reviews_of_security_podcasts Reviews of security podcasts]&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/2017_BASC_Homepage Boston Application Security Conference 2017] &lt;br /&gt;
&lt;br /&gt;
[[2016 BASC Homepage|Boston Application Security Conference 2016]]&lt;br /&gt;
&lt;br /&gt;
[[2015 BASC Homepage|Boston Application Security Conference 2015]]&lt;br /&gt;
&lt;br /&gt;
[[2014 BASC Homepage|Boston Application Security Conference 2014]]&lt;br /&gt;
&lt;br /&gt;
[[2013 BASC Homepage|Boston Application Security Conference 2013]]&lt;br /&gt;
&lt;br /&gt;
[[2012 BASC Homepage|Boston Application Security Conference 2012]] &lt;br /&gt;
&lt;br /&gt;
[[2011 BASC Homepage|Boston Application Security Conference 2011]] &lt;br /&gt;
&lt;br /&gt;
[[2010 BASC Homepage|Boston Application Security Conference 2010]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Boston OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
'''Contact'''&lt;br /&gt;
&lt;br /&gt;
* Email the [mailto:boston-leaders@owasp.org chapter leaders].&lt;br /&gt;
&lt;br /&gt;
'''President''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:jim.weiler@owasp.org Jim Weiler] 781 356 0067 &lt;br /&gt;
&lt;br /&gt;
'''Board of Directors''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:lindaleigh.aberdale@owasp.org LindaLeigh Aberdale]&lt;br /&gt;
* [mailto:mark.arnold@owasp.org Mark Arnold] &lt;br /&gt;
* [mailto:tom.conner@owasp.org Tom Conner] &lt;br /&gt;
* [mailto:mike.perez@owasp.org Mike Perez]&lt;br /&gt;
* [mailto:roy.wattanasin@owasp.org Roy Wattanasin]&lt;br /&gt;
* [mailto:pedro.marcano@owasp.org Pedro Marcano]&lt;br /&gt;
* [mailto:Mark.Schlepphorst@owasp.org Mark Schlepphorst] &lt;br /&gt;
* [mailto:Ori.Zigindere@owasp.org Ori Zigindere] &lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
[[Category:Boston]] &lt;br /&gt;
[[Category:OWASP_Chapter]] &lt;br /&gt;
[[Category:Massachusetts]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Boston&amp;diff=250740</id>
		<title>Boston</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Boston&amp;diff=250740"/>
				<updated>2019-04-28T20:53:07Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Chapter Meetings --- Our Tenth Year */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Boston|extra=Follow @OWASPBOSTON on Twitter. The chapter leader is [mailto:boston@owasp.org Jim Weiler]. The Boston chapter is grateful for support from Constant Contact, Salesforce, Microsoft and Akamai for generously hosting space and their hospitality for various events.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
The Chapter would also like to thank our sponsors for their generous support.|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Boston|emailarchives=http://lists.owasp.org/pipermail/owasp-Boston}}&lt;br /&gt;
&lt;br /&gt;
== Chapter Sponsor ==&lt;br /&gt;
[[File:SIlogostacked.png|Security Innovation|https://www.securityinnovation.com/]]&lt;br /&gt;
&lt;br /&gt;
[[File:Veracode logo.png|Veracode|https://www.veracode.com/]]&lt;br /&gt;
&lt;br /&gt;
== Boston Application Security Conference ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Boston-Banner-468x60.gif|link=2018_BASC_Homepage]] [[Image:twitter_32.png|link=https://twitter.com/@BASConf]] BASC 2019, the Boston Application Security Conference will take place 8:30am to 6:30pm on Saturday, October 19th at Microsoft, 5 Wayside Road, Burlington, MA.  [[2018 BASC Homepage|Read more]]&lt;br /&gt;
&lt;br /&gt;
== Chapter Meetings --- Our Fifteenth Year ==&lt;br /&gt;
&lt;br /&gt;
We now use [http://www.meetup.com/owaspboston/ meetup] to organize meetings.&lt;br /&gt;
&lt;br /&gt;
We meet whenever a speaker and a venue have available dates,  6:30 to 9 pm. &lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to come to any meeting, there is no signup or joining criteria, just come if it sounds interesting. Feel free to sign up to the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. This list is very low volume (2 - 3 emails/month); it is used to remind people about each monthly meeting, inform about local application security events and special chapter offers. &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Information for meeting updates about this and other Boston area user groups can also be found at [http://bug.bostonusergroups.org/Lists/Groups%20Calendar/calendar.aspx BostonUserGroups]. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
Upcoming Meetings&lt;br /&gt;
&lt;br /&gt;
 ''January 29th, 2019'' - Cambridge [https://web.securityinnovation.com/owaspboston2019 Partnered with Security Innovation]&lt;br /&gt;
&lt;br /&gt;
Location: [https://goo.gl/maps/w11GUuJJAbo Quick Base office]&lt;br /&gt;
&lt;br /&gt;
5PM- '''Just bring your computer and evil inner-doer and you are ready to roll!'''&lt;br /&gt;
&lt;br /&gt;
Security Innovation is teaming up with OWASP Boston to offer attendees a fun &amp;quot;find the vulnerabilities&amp;quot; game - CMD+CTRL Cyber Range - that shows how hackers break into websites and teaches the importance of secure coding habits.  &lt;br /&gt;
&lt;br /&gt;
The CMD+CTRL Cyber Range we will be using is called ShadowBank, a banking website where players compete to find vulnerabilities, score points, and move up the leaderboard.  Leveraging cheat sheets, attack tables, and expert led training sessions, platers take their shot at stealing money, manipulating share prices, and conducting other nefarious acts.&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Training ===&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Past Meetings ===&lt;br /&gt;
 ''June 14th, 2017'' - Burlington [https://www.meetup.com/owaspboston/events/240033562/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
7:00 pm  ''' Is RASP Ready?'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection is overhyped, according to many analysts and pundits. RASP promises applications that protect themselves - which sounds impossible - how can an application possibly protect itself? An agent that sits inside the app sounds like a deployment nightmare at worst, and a drain on the app at best. What’s the reality? Where are we now and what have we learned? &lt;br /&gt;
&lt;br /&gt;
We’ve seen deployment successes and failures, and we will draw from those specific experiences to describe: &lt;br /&gt;
Where does RASP work? &lt;br /&gt;
* What applications are well-suited for RASP? &lt;br /&gt;
* What types (organizational structure, culture, or skillset) of organizations are well-suited for RASP?&lt;br /&gt;
&lt;br /&gt;
What is the reality of RASP? &lt;br /&gt;
* Is RASP a deployment model or a feature set? &lt;br /&gt;
* How mature is RASP? Is it an over-hyped immature space, enterprise-ready, or somewhere in between? &lt;br /&gt;
* Which RASP capabilities do organizations use? And how do they validate those capabilities in their own environments? &lt;br /&gt;
* Can RASP replace the WAF?&lt;br /&gt;
&lt;br /&gt;
We will conclude, not with a sales pitch, but some lessons learned on: the three must have attributes for RASP, some suggestions on good candidates for RASP – both types of teams and types of applications, and finally - if, how, and when to get started. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Michael Feiertag, CEO and Co-Founder, tCell &lt;br /&gt;
Before co-founding tCell at the end of 2014, Michael led a string of successful products – most recently as head of products at Okta, and prior to that, as technology director at Blue Coat. Prior to Blue Coat, Michael held product management, engineering, and sales positions at several start-ups. Michael holds a B.S. from The University of Chicago, and an M.S. from the University of Maryland&lt;br /&gt;
&lt;br /&gt;
 '''May 2, 2017''' - Burlington [https://www.meetup.com/owaspboston/events/239130768/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=5+Wall+St.%2C+Burlington%2C+MA%2C+us SalesForce (was Demandware) 5 Wall St., Burlington, MA]&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
5:30 - 6:15 - '''Chat, Chew and Brew'''&lt;br /&gt;
&lt;br /&gt;
6:15 - 6:45 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
Chapter and OWASP events and news, audience announcements, questions, application security news(Google and Symantec certs, HTML5, Chrome features, SDLC and Microservices, others?)&lt;br /&gt;
&lt;br /&gt;
6:50 pm  '''Random Number Generation - Lava Lamps, Clouds, New Standards and the IoT - Richard Moulds'''&lt;br /&gt;
&lt;br /&gt;
The SANS Institute recently listed &amp;quot;Weak random number generators&amp;quot; as one of the 7 most dangerous security techniques to watch in 2017. But how do you really know how good your random numbers are? Virtualization and IoT make things worse and new standards are a wake-up call. Random numbers are the basis of security for all cryptography, yet they are often taken for granted. Without entropy, crypto is just math.  &lt;br /&gt;
&lt;br /&gt;
Learn why random numbers are so hard to generate and validate, compare different technologies in use today across virtualized environments, and discuss operational steps to take the risk out of random numbers and help secure cryptosystems even into the era of quantum computers. &lt;br /&gt;
&lt;br /&gt;
''Speaker'': Richard Moulds, General Manager of Whitewood Security, has spoken at RSA 2017 and at several OWASP chapter events in New York, Chicago and Austin. Richard has over 20 years of experience in the area of cryptography and encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2, 2016''' - Cambridge [https://www.meetup.com/owaspboston/events/234648485/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 90 Broadway, Cambridge, MA 02142 (down the street from the usual location)&lt;br /&gt;
&lt;br /&gt;
Everyone should report to Akamai 90 Broadway in the lobby and indicate about the Meetup. Someone form the staff will escort them to the 12th floor.&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
7:00 '&amp;lt;nowiki/&amp;gt;''Advanced Persistent Legal Threats''' - '''''&amp;lt;nowiki/&amp;gt;'''William Gamble, JD, LLM, EMBA'''&lt;br /&gt;
&lt;br /&gt;
Abstract: Good cyber security can protect IT infrastructure against many attacks. Because of the difficulty in monetizing cyber thefts, the direct loss of a breach can be limited. However, the legal costs, both from government agencies and plaintiffs, can be far greater. The legal landscape, both in the US and internationally is changing as fast if not faster than the technology.&lt;br /&gt;
&lt;br /&gt;
Bio: I am a lawyer and a member of the Florida Bar.I used to practice tax, securities and banking law. I have written three books and spoken around the world on the economic efficiency of legal and regulatory infrastructures specifically in emerging markets like China. Over the past two years, I have immersed myself in cyber security. I now hold the CompTIA A+, Network+, and Security+. I will take the CASP next month. Besides keeping up with the regulations, I am studying incident response and auditing. I am also working toward my health care law certification. My hero is Dr. Johannes Ullrich.&lt;br /&gt;
&lt;br /&gt;
 '''September 28, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/233921522/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, Announcements'''&lt;br /&gt;
&lt;br /&gt;
6:15 '''OWASP Top 10 #1 - Injection Flaws'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss XML External Entity Injection flaws; how it works, how to prevent, code examples.&lt;br /&gt;
&lt;br /&gt;
6:45 '&amp;lt;nowiki/&amp;gt;''From the Frontlines of RASP Adoption''' - '''''&amp;lt;nowiki/&amp;gt;'''Goran Begic, VP of Product, IMMUNIO'''&lt;br /&gt;
&lt;br /&gt;
Runtime Application Self-Protection (RASP) is one of the newest technologies coined by Gartner and it is in early stages of adoption in the industry. It promises dynamic defense and automatic mitigation of vulnerabilities in web applications.&lt;br /&gt;
&lt;br /&gt;
This presentation is a summary of experiences from several dozens of commercial evaluations and early adoptions in production that took place this year and provides some examples of situations and challenges that are not specific to any individual vendor. In this talk Goran will provide an overview of buying criteria and evaluation requirements across different industries and some typical pitfalls that can slow down adoption.&lt;br /&gt;
&lt;br /&gt;
After the introduction and a brief reminder on the technology Goran will invite audience to participate in discussion about organizational requirements for adoption and operationalization of RASP. &lt;br /&gt;
&lt;br /&gt;
Questions for discussion: &lt;br /&gt;
&lt;br /&gt;
My application is under attack. &lt;br /&gt;
*What actions should I take? &lt;br /&gt;
*Who owns the response? &lt;br /&gt;
*Which attacks should I respond to and which ones can I ignore?&lt;br /&gt;
*How to get started with mitigation provided by technology? &lt;br /&gt;
*Does RASP fit with DevOps? &lt;br /&gt;
*Does RASP help with remediation? &lt;br /&gt;
&lt;br /&gt;
What this presentation is not: This is not a product pitch in any way. Evaluation criteria, comparison of RASP with IAST and other security technologies, personal experiences and examples discussed in this talk are generally applicable to all RASP solutions. &lt;br /&gt;
&lt;br /&gt;
Key takeaways:&lt;br /&gt;
&lt;br /&gt;
At the end of the presentation you will: &lt;br /&gt;
*get a better understanding of requirements for evaluation of RASP and its use cases, &lt;br /&gt;
*if you can pull a successful evaluation alone, or if you will need participation of other groups / teams &lt;br /&gt;
*learn about critical criteria for success of RASP in production &lt;br /&gt;
*how this criteria different relative to appsec testing tools.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 7, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Docker Containers and Application Security''' - '''Tsvi Korren'''&lt;br /&gt;
&lt;br /&gt;
Docker containers are transforming the way applications are developed and deployed. Closely tied to DevOps and Continuous Delivery, containers introduce both risks and opportunities to security management in Web applications. This talk will introduce the basic concepts of containers, how companies use them today and how to support this technology while elevating the security posture of your application stacks.&lt;br /&gt;
&lt;br /&gt;
Tsvi Korren, CISSP, has been an enterprise IT professional for 20 years with background in business process consulting in large organizations. Most recently at CA Technologies, he worked across verticals in government, retail, financial institutions and healthcare to implement compliance and security processes, from Identity and Access to Host and Server Controls. Tsvi is currently the director of technical services at Aqua, concentrating on building bridges between DevOps and Security.&lt;br /&gt;
&lt;br /&gt;
 '''June 8, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/230842887/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6-6:30 '''News, announcements, job postings, etc. '''&lt;br /&gt;
&lt;br /&gt;
6:30-7 '''Introduction to SQL Injection - Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Computer Science Curricula’s Failure - What Should We Do Now?''' - '''Ming Chow &amp;amp; Roy Wattanasin'''&lt;br /&gt;
&lt;br /&gt;
We are still facing the same security vulnerabilities from over a decade ago. The problems are not going away anytime soon and a reason is because Computer Science curricula are still churning out students who are not even exposed to security. This talk will address the lack of emphasis on information security in Computer Science curricula, how CS curricula have an obligation, how to gradually fix the problem by integrating security into many Computer Science undergraduate and graduate classes, and success stories from students. This talk will also discuss what Tufts and Brandeis are currently working on to further address the security education problem by creating a joint cyber security and policy program that spans multiple departments. Additional points and feedback from the audience are encouraged to help with the issue. All are encourage to attend to submit your feedback to help!&lt;br /&gt;
&lt;br /&gt;
Presenters: &lt;br /&gt;
&lt;br /&gt;
Ming Chow - @0xmchow &lt;br /&gt;
&lt;br /&gt;
Ming Chow is a Senior Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He was a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World, DEF CON, Intel, SOURCE Conference, and BSides Boston. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2014 and 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin - @wr0 &lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin is an adjunct faculty at Brandeis University in both the Health and Medical Informatics and Information Security graduate programs. He spends most of his time leading, teaching and developing information security programs, finding vulnerabilities, performing incident response and working on many projects. Roy has spoken at many conferences including RSA, ISSA International, Source Conference, Braintank, Cyber Security World, OWASP and the Security BSides conferences. He is also a healthcare information security professional. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2015. &lt;br /&gt;
&lt;br /&gt;
 '''May 4, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229788205/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Slightly different [http://www.akamai.com/html/about/locations.html Akamai] location: 90 Broadway, Cambridge, MA 02142 between Meadhall and the Mariott&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZAP''' - '''Dan Cornell'''&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons to use source code to assist in web application penetration testing such as making better use of penetration testers’ time, providing penetration testers with deeper insight into system behavior, and highlighting specific sections of so development teams can remediate vulnerabilities faster. Examples of these are provided using the open source ThreadFix plugin for the OWASP ZAP proxy and dynamic application security testing tool. These show opportunities attendees have to enhance their own penetration tests given access to source code.&lt;br /&gt;
&lt;br /&gt;
This presentation covers the “ABCs” of source code assisted web application penetration testing: covering issues of attack surface enumeration, backdoor identification, and configuration issue discovery. Having access to the source lets an attacker enumerate all of the URLs and parameters an application exposes – essentially its attack surface. Knowing these allows pen testers greater application coverage during testing. In addition, access to source code can help to identify potential backdoors that have been intentionally added to the system. Comparing the results of blind spidering to a full attack surface model can identify items of interest such as hidden admin consoles or secret backdoor parameters. Finally, the presentation examines how access to source code can help identify configuration settings that may have an adverse impact on the security of the deployed application.&lt;br /&gt;
&lt;br /&gt;
Dan Cornell is a globally recognized application security expert, Dan Cornell holds over 15 years of experience architecting, developing and securing web-based software systems. As the Chief Technology Officer and a Principal at Denim Group, Ltd., he leads the technology team to help Fortune 500 companies and government organizations integrate security throughout the development process. He is also the original creator of ThreadFix, Denim Group's industry leading application security program management platform. Cornell was Principal Investigator as Denim Group researched and developed the Hybrid Analysis Mapping (HAM) technology that lies at the heart of ThreadFix, through a Small Business Innovation Research (SBIR) contract with the Department of Homeland Security's Science and Technology Directorate.&lt;br /&gt;
&lt;br /&gt;
More information at: http://www.denimgroup.com/about_team_dan.html&lt;br /&gt;
&lt;br /&gt;
 '''April 6, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Runtime Application Self-Protection (RASP) Tools''' - '''Kunal Anand'''&lt;br /&gt;
&lt;br /&gt;
This talk will highlight the latest in AppSec and dive into a different kind of solution called Runtime Application Self-Protection (RASP). We'll also explore a new methodology called language theoretic security (LANGSEC) and explain how it can outperform existing approaches like pattern matching, regular expressions, etc. This talk will lay the foundation via informal and formal theory how lexers, tokenizers and parsers work. We’ll move onto constructing an open source toolchain to analyzing data and exploring interactive data visualizations. Along the way, we’ll cover performance tradeoffs and discuss the challenges of modern application security.&lt;br /&gt;
&lt;br /&gt;
Kunal Anand is the co-founder and CTO of Prevoty, a runtime application security platform. Prior to that, he was the Director of Technology at the BBC Worldwide, overseeing engineering and operations across the company’s global Digital Entertainment and Gaming initiatives. Kunal also has several years of experience leading security, data and engineering at Gravity, MySpace and NASA’s JetPropulsion Laboratory. His work has been featured in Wired Magazine and Fast Company. Kunal received a B.S. from Babson College.&lt;br /&gt;
&lt;br /&gt;
=== Past Training ===&lt;br /&gt;
&lt;br /&gt;
 '''June 12th thru 14th 2017''' - Waltham &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==February 21st thru 23d 2018 - Location: Dun and Bradstreet 610 Lincoln Street North Building Waltham, Massachusetts 02451==&lt;br /&gt;
&lt;br /&gt;
8AM to 5PM '''3 Day Developer Edition - Practical Web Application Penetration Testing (PWAPT)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Developer Edition contains the same content as the original PWAPT course (Standard Edition), but adds a full day of code remediation lecture and exercises. The code remediation content includes discussions on the proper techniques for mitigating vulnerabilities, and exercises where the instructor and students will modify the application's source code to implement mitigating controls and test them for effectiveness. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This course provides customized training on the latest open source tools and manual techniques for performing end-to-end web application penetration testing engagements. After a quick overview of the penetration testing methodology, the instructor will lead students through the process of testing and exploiting a target web application using the techniques and approaches developed from a career of real world application penetration testing experiences. Students will be introduced to the best open source tools currently available for the specific steps of the methodology, including Burp Suite Pro, and taught how to integrate these tools with manual testing techniques to maximize effectiveness. A major goal of this course is teaching students the glue that brings the tools and techniques together to successfully perform a web application penetration test from beginning to end, an oversight in most web application penetration testing courses.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The majority of the course will be spent performing an instructor led, hands-on web application penetration test against a target application built specifically for this class using a modern technology stack (Python Flask) and including real vulnerabilities as encountered in the wild. No old-school vanilla PHP stuff here folks. Students won’t be given overly simplistic steps to execute independently. Rather, at each stage of the test, the instructor will present the goals that each testing task is to accomplish and perform the penetration test in front of the class while students do it on their own machine. Primary emphasis of these instructor led exercises will be placed on how to integrate the tools with manual testing procedures to improve the overall work flow. This experience will help students gain the confidence and knowledge necessary to perform web application penetration tests as an application security professional.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;PWAPT is a PortSwigger preferred [https://portswigger.net/training Burp Suite Training] course. PWAPT students will learn basic and advanced usage techniques for Burp Suite Pro, as well as discover obscure functionality hidden within the vast capabilities of the tool. Students will also receive a 2 week trial license for Burp Suite Pro to use during the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;outline&amp;quot;&amp;gt;Outline&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 1:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Methodology&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Reconnaissance&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Mapping&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Automated Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 2:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery (cont.)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Exploitation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Web Services&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 3: (Developer Edition only)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Remediation&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;technical-requirements&amp;quot;&amp;gt;Technical Requirements&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Laptop with at least two (2) USB ports.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Latest VMware Player, VMware Workstation, or VWware Fusion installed. Other virtualization software such as Parallels or VirtualBox will probably work if the attendee is familiar with its functionality. However, VMware Player should be prepared as a backup.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Ability to disable all security software on their laptop such as Antivirus and/or firewalls (Administrator).&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least twenty (20) GB of hard drive space.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least four (4) GB of RAM.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tim (lanmaster53) Tomes&lt;br /&gt;
&lt;br /&gt;
Christian, father, husband, veteran, code slinger, aspiring difference-maker and hacking enthusiast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Training in ''Tactical DevSecOps: Web Application Testing and Monitoring''==&lt;br /&gt;
&lt;br /&gt;
Sign-Up: http://tinyurl.com/OWASPDevSecOps&lt;br /&gt;
&lt;br /&gt;
Cost: &lt;br /&gt;
* $900 for Non Members&lt;br /&gt;
* $850 for OWASP Members&lt;br /&gt;
* Some US Active Military, Law Enforcement &amp;amp; US Veteran seats are being held aside for FREE entry per the enormous generosity of the trainer!  Please be prepared to send us verification of status.&lt;br /&gt;
Contact us at boston[at]owasp[dot]org&lt;br /&gt;
&lt;br /&gt;
When: Monday, June 12, 2017 8:00 AM to Wednesday, June 14th, 2017, 4:30 PM ET&lt;br /&gt;
&lt;br /&gt;
Location: 610 lincoln street (north) Waltham, MA 02145&lt;br /&gt;
&lt;br /&gt;
Instructor: [https://www.secureideas.com/about-me.php?bio=kevin Kevin &amp;quot;Professionally Evil&amp;quot; Johnson], who has taught at SANS, and presented at BlackHat &amp;amp; DerbyCon&lt;br /&gt;
&lt;br /&gt;
 '''January 25th thru 27th 2017''' - Waltham &lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact [https://www.google.com/maps/place/Constant+Contact/@42.4185837,-71.2586063,15z/data=!4m5!3m4!1s0x0:0xbcaab68dd299cf76!8m2!3d42.4185837!4d-71.2586063 Map] location: 1601 Trapelo Rd, Waltham, MA 02451 - the building on the right furthest away from Trapelo Road&lt;br /&gt;
&lt;br /&gt;
8AM to 5PM '''3 Day Developer Edition - Practical Web Application Penetration Testing (PWAPT)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Developer Edition contains the same content as the original PWAPT course (Standard Edition), but adds a full day of code remediation lecture and exercises. The code remediation content includes discussions on the proper techniques for mitigating vulnerabilities, and exercises where the instructor and students will modify the application's source code to implement mitigating controls and test them for effectiveness. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This course provides customized training on the latest open source tools and manual techniques for performing end-to-end web application penetration testing engagements. After a quick overview of the penetration testing methodology, the instructor will lead students through the process of testing and exploiting a target web application using the techniques and approaches developed from a career of real world application penetration testing experiences. Students will be introduced to the best open source tools currently available for the specific steps of the methodology, including Burp Suite Pro, and taught how to integrate these tools with manual testing techniques to maximize effectiveness. A major goal of this course is teaching students the glue that brings the tools and techniques together to successfully perform a web application penetration test from beginning to end, an oversight in most web application penetration testing courses.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The majority of the course will be spent performing an instructor led, hands-on web application penetration test against a target application built specifically for this class using a modern technology stack (Python Flask) and including real vulnerabilities as encountered in the wild. No old-school vanilla PHP stuff here folks. Students won’t be given overly simplistic steps to execute independently. Rather, at each stage of the test, the instructor will present the goals that each testing task is to accomplish and perform the penetration test in front of the class while students do it on their own machine. Primary emphasis of these instructor led exercises will be placed on how to integrate the tools with manual testing procedures to improve the overall work flow. This experience will help students gain the confidence and knowledge necessary to perform web application penetration tests as an application security professional.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;PWAPT is a PortSwigger preferred [https://portswigger.net/training Burp Suite Training] course. PWAPT students will learn basic and advanced usage techniques for Burp Suite Pro, as well as discover obscure functionality hidden within the vast capabilities of the tool. Students will also receive a 2 week trial license for Burp Suite Pro to use during the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;outline_2&amp;quot;&amp;gt;Outline&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 1:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Methodology&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Reconnaissance&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Mapping&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Automated Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 2:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery (cont.)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Exploitation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Web Services&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 3: (Developer Edition only)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Remediation&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;technical-requirements_2&amp;quot;&amp;gt;Technical Requirements&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Laptop with at least two (2) USB ports.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Latest VMware Player, VMware Workstation, or VWware Fusion installed. Other virtualization software such as Parallels or VirtualBox will probably work if the attendee is familiar with its functionality. However, VMware Player should be prepared as a backup.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Ability to disable all security software on their laptop such as Antivirus and/or firewalls (Administrator).&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least twenty (20) GB of hard drive space.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least four (4) GB of RAM.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tim (lanmaster53) Tomes&lt;br /&gt;
&lt;br /&gt;
Christian, father, husband, veteran, code slinger, aspiring difference-maker and hacking enthusiast.&lt;br /&gt;
&lt;br /&gt;
 '''July 18th &amp;amp; 19th 2016''' - Waltham&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact [https://www.google.com/maps/place/Constant+Contact/@42.4185837,-71.2586063,15z/data=!4m5!3m4!1s0x0:0xbcaab68dd299cf76!8m2!3d42.4185837!4d-71.2586063 Map] location: 1601 Trapelo Rd, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
8AM to 5PM '''Practical Web Application Penetration Testing - PWAPT'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This course provides customized training on the latest open source tools and manual techniques for performing end-to-end web application penetration testing engagements. After a quick overview of the penetration testing methodology, the instructor will lead students through the process of testing and exploiting a target web application using the techniques and approaches developed from a career of real world application penetration testing experiences. Students will be introduced to the best open source tools currently available for the specific steps of the methodology, including Burp Suite Pro, and taught how to integrate these tools with manual testing techniques to maximize effectiveness. A major goal of this course is teaching students the glue that brings the tools and techniques together to successfully perform a web application penetration test from beginning to end, an oversight in most web application penetration testing courses.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The majority of the course will be spent performing an instructor led, hands-on web application penetration test against a target application built specifically for this class using a modern technology stack (Python Flask) and including real vulnerabilities as encountered in the wild. No old-school vanilla PHP stuff here folks. Students won’t be given overly simplistic steps to execute independently. Rather, at each stage of the test, the instructor will present the goals that each testing task is to accomplish and perform the penetration test in front of the class while students do it on their own machine. Primary emphasis of these instructor led exercises will be placed on how to integrate the tools with manual testing procedures to improve the overall work flow. This experience will help students gain the confidence and knowledge necessary to perform web application penetration tests as an application security professional.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;PWAPT is a PortSwigger preferred [https://portswigger.net/training Burp Suite Training] course. PWAPT students will learn basic and advanced usage techniques for Burp Suite Pro, as well as discover obscure functionality hidden within the vast capabilities of the tool. Students will also receive a 2 week trial license for Burp Suite Pro to use during the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;outline_3&amp;quot;&amp;gt;Outline&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 1:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Methodology&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Reconnaissance&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Mapping&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Automated Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 2:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery (cont.)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Exploitation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Web Services&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;technical-requirements_3&amp;quot;&amp;gt;Technical Requirements&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Laptop with at least two (2) USB ports.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Latest VMware Player, VMware Workstation, or VWware Fusion installed. Other virtualization software such as Parallels or VirtualBox will probably work if the attendee is familiar with its functionality. However, VMware Player should be prepared as a backup.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Ability to disable all security software on their laptop such as Antivirus and/or firewalls (Administrator).&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least twenty (20) GB of hard drive space.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least four (4) GB of RAM.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tim (lanmaster53) Tomes&lt;br /&gt;
&lt;br /&gt;
Christian, father, husband, veteran, code slinger, aspiring difference-maker and hacking enthusiast.&lt;br /&gt;
&lt;br /&gt;
 '''March 16, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/229156529/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Demandware, Burlington.&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
6:30 '''Software Security by the Numbers''' - '''Chris Eng'''&lt;br /&gt;
&lt;br /&gt;
Deep dive into data we’ve collected about the state of software security in 2016 &lt;br /&gt;
* Based on scans of 200,000+ applications over an 18-month period &lt;br /&gt;
* How different industries and programming languages compare to one another &lt;br /&gt;
* Vulnerability remediation habits and patterns &lt;br /&gt;
* Three characteristics of a successful AppSec program &lt;br /&gt;
&lt;br /&gt;
Chris Eng is vice president of research at Veracode. In this role, he leads the team responsible for integrating security expertise into all aspects of Veracode’s technology. Throughout his career, he has led projects breaking, building, and defending web applications and commercial software for some of the world’s largest companies. Chris is a frequent speaker at premier industry conferences, where he has presented on a diverse range of topics, including cryptographic attacks, agile security, mobile application security, and security metrics. He has been interviewed by Bloomberg, Fox Business, CBS, and other media outlets worldwide.&lt;br /&gt;
&lt;br /&gt;
 '''January 26, 2016''' - Waltham - [http://www.meetup.com/owaspboston/events/228202040/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Waltham.  Trapelo Rd. exit from Rt. 128, toward Lincoln. The parking lot entrance is on the right, at the first traffic light. Drive around to the front of the office complex, facing the highway. Enter under the clock tower. Park in the front of the building and enter in the main building lobby, continue down the hallway and you will see the innovation center, enter in the large glass doors. &lt;br /&gt;
&lt;br /&gt;
7:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:20 '''What Security Testing Tools Miss'''&lt;br /&gt;
&lt;br /&gt;
Black Duck Software presents - Static analysis, dynamic analysis, and other testing tools are all essential weapons against adversaries.  But for the 80%+ of companies worldwide that use open source software in their application development these tools are ineffective in identifying and mitigating open source security risks . This presentation will cover:&lt;br /&gt;
&lt;br /&gt;
The value of static and dynamic tools, and where they best fit in the Secure Development Lifecycle          &lt;br /&gt;
&lt;br /&gt;
Why these tools are not useful in identifying known vulnerabilities in open source components          &lt;br /&gt;
&lt;br /&gt;
Controls development and security professionals can deploy to select, detect, manage and monitor open source for existing and newly disclosed vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Food will be provided by Constant Contact.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2015''' - Cambridge - [http://www.meetup.com/owaspboston/events/226394218/ Meetup]&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
Attendee interaction is always mentioned as a high value at meetings and was great at the MetroWest meetings, so we're doing that at Akamai this month. Some discussion starters so far: SSL certificate impacts from CA/Browser alliance decisions and SHA1 weakness; mutual (client) SSL, javascript client and server side; what the heck is threat intelligence, dev ops and faster secure SDLC.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Metrowest&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 20, 7:00 pm&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Innovation Center, Reservoir Place, 1601 Trapelo Road, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
7:00 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:30 '''Access in Maliceland - Risk Based Access Control''' - '''Gunnar Peterson'''&lt;br /&gt;
&lt;br /&gt;
John Lambert observed attackers win because while defenders think in lists, attackers think in graphs. Access control systems divide the system a priori into secure and insecure states. But that’s only worth the paper its printed on. A  Attackers see the system as it is, for attackers, the access control scheme is the beginning of the game not the end. Determined attackers seek out access control models and then find holes that they can leverage. Access control systems that purport to protect the system are built on assumptions from which reality diverges. Application security needs a new approach to access control- adding feedback loops for risk based decisions,  fine-grained, dynamic access control. &lt;br /&gt;
&lt;br /&gt;
Security is a business with a very long list of issues and requirements. The spreadsheets are miles long. This makes it essential to find reusable solution patterns that can address multiple problems.This presentation looks at both medium term improvements and code examples to improve access control decisions and overall security today&lt;br /&gt;
&lt;br /&gt;
Gunnar Peterson ([https://twitter.com/oneraindrop @oneraindrop]) focuses on security architecture consulting and training. Experience includes Associate Editor for IEEE Security &amp;amp; Privacy Journal, a Microsoft MVP for App security, an IANS Research Faculty member, a Securosis Contributing Analyst, and a Visiting Scientist at Carnegie Mellon Software Engineering Institute. He maintains a popular information security blog at http://1raindrop.typepad.com.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Cambridge&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 8, 6:30 pm  ''NOTE: It's the second Wednesday this month.''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
 '''June 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Put Down the Megaphone: Effective Security Advocacy Without the Shouting''' - '''Darren Meyer'''&lt;br /&gt;
&lt;br /&gt;
10 years’ experience in the InfoSec community--including work with organizations in many verticals, in sizes ranging from startups to Fortune 50 enterprises, leading Application Security teams, building and delivering security instruction to developers, managers, and InfoSec professionals—has taught me the importance of crafting advocacy for different audiences. In this talk, I share my experiences in learning to be an effective advocate with three key audiences: developers, management, and non-technical staff.&lt;br /&gt;
&lt;br /&gt;
Darren is an Application Security advocate and researcher, technology hobbyist, and maker. He loves to learn, teach, nerd out, and inflict terrible puns on people. His background includes logistics, software development, and an assortment of information security roles including leading AppSec programs and professional security instruction targeting developers, managers, and InfoSec professionals.&lt;br /&gt;
&lt;br /&gt;
 '''May 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How the crowd is discovering critical vulns missed by traditional methods''' - '''Leif Dreizler'''&lt;br /&gt;
&lt;br /&gt;
State of the art security programs are turning to bug bounties to leverage a vast array of skill-sets and knowledge. Learn why these programs work, when to deploy them, and how you can bring these new application security testing capabilities into your own organization. The speaker will discuss real world examples from bug bounties and focus on cases where business logic flaws and high priority vulnerabilities were found ... even with existing security testing processes in place. &lt;br /&gt;
&lt;br /&gt;
Attendees will learn:&lt;br /&gt;
&lt;br /&gt;
Testing methods deployed by our crowd that help them find bugs the scanners miss&lt;br /&gt;
&lt;br /&gt;
Examples of the high quality of bugs our crowd is finding, including P1'sTrends which vulnerability types are found most often and whyWhat is the ROI on the pay for performance modelWhere does the SDLC merge into crowdsourced testing&lt;br /&gt;
&lt;br /&gt;
Leif Dreizler is a Senior Security Engineer at Bugcrowd, the innovator in crowdsourced security testing for the enterprise. Prior to joining Bugcrowd, Leif was a Senior Application Security Engineer at Redspin, performing application security assessments. During his time at Redspin he also served as the Application Team Lead, liaising with clients at the engineering and sales level. He has also made minor contributions to the Firebug project. Leif attended the University of California, Santa Barbara where he studied Computer Science. Leif recently spoke to the NYC Security Meet-up group.&lt;br /&gt;
&lt;br /&gt;
 '''April 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler Will show some actual examples and patterns of SQL Injection attempts&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Are You An Imposter? Me too!''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
Many people in the information security field feel like a fraud, or an imposter. In reality, we often know far more, and are capable of far more than we believe we do. There is so much to know and we constantly hear about the latest groundbreaking research done by others, which makes us feel less important or worthy. Let’s talk about what Imposter Syndrome is, its prevalence, and then we can start to realize just how capable we are and go forward with the confidence in the field.&lt;br /&gt;
&lt;br /&gt;
 '''March 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, March 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Prioritizing Web Application Vulnerabilities – A Hacker’s Perspective''' - '''Nick Silver'''&lt;br /&gt;
&lt;br /&gt;
The best application risk models capture not only the technical risk factors, but also the business context in which an asset lives.  Traditionally, this is done by auditing application owners on an array of questions in order to properly classify the asset and its data – but that takes time which could be better spent elsewhere.  We interviewed dozens of hackers and asked them which vulnerabilities they would look for first depending on the type of attack they wanted to carry out.  We’ll walk through several examples of how to use this data as a shortcut means for prioritizing risk without the need for any pesky audit questionnaires.&lt;br /&gt;
&lt;br /&gt;
Nick Silver is a Senior Solutions Architect with WhiteHat Security.  He is responsible for translating business requirements into technical ones and assisting businesses in implementing web security programs.  Previously, Nick led a team in WhiteHat’s Threat Research Center where they were responsible for testing more than 2,000 of their customers’ websites for vulnerabilities.  &lt;br /&gt;
&lt;br /&gt;
 '''February 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, announcements''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Incident Response and Web Application Security - Stories from the Trenches''' - '''Fred House and Joe Ceirante'''&lt;br /&gt;
&lt;br /&gt;
Mandiant has conducted numerous incident response engagements throughout its history, including a record number of 200 incidents in 2014. Mandiant consultants Fred House and Joe Ceirante will discuss case studies and trends Mandiant has observed in relation to web application security.&lt;br /&gt;
 &lt;br /&gt;
Topics will include the types of threat actors that target web applications, the techniques they use to compromise web applications, and the activities they perform once inside the network. Techniques for detecting and mitigating web compromises will also be reviewed. All content will be derived from the real-world compromises that Mandiant has investigated.&lt;br /&gt;
&lt;br /&gt;
 '''January 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 7, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, risk analysis of Poodle''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How a Hacker Views Your Web Site''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
''The most popular presentation of BASC 2014''&lt;br /&gt;
&lt;br /&gt;
As defenders, we have to be right 100% of the time where an attacker only needs to be right once. The attack surface of a modern web site is incredibly large and we need to be aware of all of it. Additionally, individual attacks may not always be effective but sometimes using them together can gain the desired effect. In this talk, we’ll take a look at the whole attack surface for a typical web site and the various ways that an attacker will use to compromise a site.&lt;br /&gt;
&lt;br /&gt;
 '''December 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, December 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News and Views You Can Use and Abuse''' - '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
* Some thoughts and analysis on some current app security news and other stuff&lt;br /&gt;
* Adobe password breach&lt;br /&gt;
* Reducing Web Application Firewall SQL injection false positives&lt;br /&gt;
 &lt;br /&gt;
7:15 '''Swift and Security''' - '''Ming Chow'''&lt;br /&gt;
 &lt;br /&gt;
Apple is pushing its new programming language Swift for iOS development and for many good reasons.  This talk will discuss what the language has right in terms of security, the old and new security pitfalls, and what developers need to be aware of moving forward with using the new language.  The fact to the matter is, iOS isn't going away, iOS developers will need to learn and use Swift, and there will be a big rush of Swift-based apps: we might as well learn how to do it right the first time around.&lt;br /&gt;
 &lt;br /&gt;
Ming Chow is an Instructor at the Department of Computer Science, Tufts University. Ten years of web development experience.&lt;br /&gt;
Specialties: Web and Mobile Development, Web and Mobile Security&lt;br /&gt;
&lt;br /&gt;
 '''July 2014'''&lt;br /&gt;
&lt;br /&gt;
Topics: '''Grails Security''' and '''Validating Cross-Site Scripting Vulns with xssValidator'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Cyrus Malekpour''' and '''John Poulin'''&lt;br /&gt;
&lt;br /&gt;
When: Tuesday, July 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic 1: ''Grails Security''&lt;br /&gt;
&lt;br /&gt;
Grails is a framework developed for Groovy in the vein of Rails for Ruby. It provides a lot of features for web app security, but does it do enough? What might you need to implement yourself, and what might be provided? This presentation will discuss tips on securing Grails applications, including tools that the framework provides by default for security. It'll also discuss several shortcomings in the current toolset, and how you can avoid them.&lt;br /&gt;
 &lt;br /&gt;
Cyrus Malekpour (@cmalekpour) is currently interning at nVisium, working on web app development and security. He's currently an undergraduate student at the University of Virginia, where he's studying computer science with an emphasis on security and backend development. &lt;br /&gt;
 &lt;br /&gt;
Topic 2: ''Validating Cross-Site Scripting Vulns with xssValidator''&lt;br /&gt;
 &lt;br /&gt;
xssValidator is a tool developed to automate the testing and validation of Cross-Site Scripting (xss) vulnerabilities within web applications. Automated scanners tend to report large amounts of false-positives, and as consultants we're forced spending our time trying to verify these findings. xssValidator leverages scriptable web-browsers such as PhantomJS and Slimer.js to automatically validate these findings.&lt;br /&gt;
 &lt;br /&gt;
John Poulin is an application security consultant for nVisium who specializes in web application security. He worked previously as a web developer and software engineer that focused on building multi-tier web applications. When he's not hacking on web apps, John spends his time building tools to help him hack on web apps! You can find him on twitter: @forced_request and on myspace: REDACTED.&lt;br /&gt;
&lt;br /&gt;
 '''June 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection and the OWASP Zed Attack Proxy (ZAP)'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Rob Cheyne and Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 - general networking, news discussion, announcements.&lt;br /&gt;
&lt;br /&gt;
7:00 - main presentations&lt;br /&gt;
&lt;br /&gt;
The June 4th meeting will be the second in our series of 2014 training meetings. Rob Cheyne will continue explaining and exploring SQL Injection by conducting an actual injection attack.&lt;br /&gt;
&lt;br /&gt;
This will be a demo-based discussion to get into the mindset of an attacker, and show how an attacker goes after a site. Demo will include: &lt;br /&gt;
&lt;br /&gt;
* BurpProxy demo &lt;br /&gt;
* Common authentication flaws &lt;br /&gt;
* SQL Injection Demo that shows the process and how it builds to a full compromise&lt;br /&gt;
&lt;br /&gt;
'''Rob Cheyne''' is currently CEO of Big Brain Security. In addition to security consulting for Fortune 500 customers, he was the author of LC4, a version of the award-winning L0phtCrack password auditing tool, and he also worked on the code scanning technology that was eventually spun off as Veracode. Rob was at @stake from the very first customer all the way through to the $50M acquisition by Symantec.&lt;br /&gt;
&lt;br /&gt;
'''Jim Weiler''' will introduce the OWASP Zed Attack Proxy (ZAP). This is a very powerful free OWASP intercepting proxy that lets you see, analyze, change, replay etc. every browser request and response, analyze your session, scan and attack web sites, save the results and run reports. We can't cover all the functionality but we'll show some practical tips and techniques.&lt;br /&gt;
&lt;br /&gt;
Pizza, salad and soda courtesy of Akamai&lt;br /&gt;
&lt;br /&gt;
 '''March 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection, WebGoat, Cross Site Request Forgery'''&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
When: Wednesday, March 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
There will be three training sessions:&lt;br /&gt;
&lt;br /&gt;
One will be on SQL Injection - intro, detection, prevention, scanning and false positives. This is the most serious web application vulnerability.&lt;br /&gt;
&lt;br /&gt;
The second will be on OWASP WebGoat. WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons. You can install and practice with WebGoat in either J2EE or in ASP.NET. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat applications. There are hints and 39 different lesson plans on various vulnerabilities and technologies. We won't cover all of them of course!&lt;br /&gt;
&lt;br /&gt;
The third will be on Cross Site Request Forgery - not a hack really, it's just the way the web works. But it causes apps to do legitimate things that you didn't ask them to do.&lt;br /&gt;
&lt;br /&gt;
Pizza and drinks provided by Akamai.&lt;br /&gt;
&lt;br /&gt;
 '''January 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''JavaScript Verification: From Browsers to Pages'''&lt;br /&gt;
&lt;br /&gt;
Modern web browsers implement a &amp;quot;private browsing&amp;quot; mode that is intended to leave behind no traces of a user's browsing activity on their computer. This feature is in direct tension with support for *extensions*, which let users add third-party functionality into their browser. I will discuss the scope of this problem, present our approach to verifying extensions' compliance with private browsing mode, and sketch our findings on several real, third-party extensions. I will then briefly describe the toolkit underlying our approach, and end with a sketch of a newer project, adapting this approach to the very different-seeming problem of statically catching errors when using the jQuery library.&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
&lt;br /&gt;
Benjamin Lerner has just completed a post-doctoral research position in the PLT group at Brown University, and is now a lecturer at Northeastern University.  His research examines the challenges of analyzing client-side web programming, from the behavior of web pages down through the semantics of the browser.  He received a PhD in Computer Science from the University of Washington in 2011, building a platform to analyze conflicts between browser extensions, and a B.S. in Computer Science and Mathematics from Yale University.&lt;br /&gt;
&lt;br /&gt;
 '''November 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Attacking iOS Applications'''  &lt;br /&gt;
&lt;br /&gt;
Slides: [http://www.slideshare.net/kfosaaen/i-os-gcandpb On slideshare]&lt;br /&gt;
&lt;br /&gt;
This presentation will cover the basics of attacking iOS applications (and their back ends) using a web proxy to intercept, modify, and repeat HTTP/HTTPS requests. (The proxy used during research was Burp; however, any HTTP intercepting proxy such as OWASP ZAP could be used) From setting up the proxy to pulling data from the backend systems, this talk will be a great primer for anyone interested in testing iOS applications at the HTTP protocol level. There will be a short (2 minute) primer on setting up the intercepting proxy, followed by three practical examples showing how to intercept data headed to the phone, how to modify data heading to the application server, and how to pull extra data from application servers to further an attack. All of these examples will focus on native iOS apps (Game Center and Passbook) and/or functionality (Passbook Passes).&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Karl Fosaaen'''&lt;br /&gt;
&lt;br /&gt;
Karl is a senior security consultant at NetSPI. This role has allowed Karl to work in a variety of industries, including financial services, health care, and hardware manufacturing. Karl specializes in network and web application penetration testing. In his spare time, Karl helps out as an OPER at THOTCON and a swag goon at DEF CON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''October 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, October 2, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Abusing NoSQL Databases'''&lt;br /&gt;
&lt;br /&gt;
The days of selecting from a few SQL database options for an application are over. There is now a plethora of NoSQL database options to choose from: some are better than others for certain jobs. There are good reasons why developers are choosing them over traditional SQL databases including performance, scalabiltiy, and ease-of-use. Unfortunately like for many hot techologies, security is largely an afterthought in NoSQL databases. This short but concise presentation will illustrate how poor the quality of security in many NoSQL database systems is. This presentation will not be confined to one particular NoSQL database system. Two sets of security issues will be discussed: those that affect all NoSQL database systems such as defaults, authentication, encryption; and those that affect specific NoSQL database systems such as MongoDB and CouchDB. The ideas that we now have a complicated heterogeneous problem and that defense-in-depth is even more necessary will be stressed. There is a common misconception that SQL injection attacks are eliminated by using a NoSQL database system. While specifically SQL injection is largely eliminated, injection attack vectors have increased thanks to JavaScript and the flexibility of NoSQL databases. This presentation will present and demo new classes of injection attacks. Attendees should be familiar with JavaScript and JSON. &lt;br /&gt;
&lt;br /&gt;
Presenter: '''Ming Chow'''&lt;br /&gt;
&lt;br /&gt;
Ming Chow (@tufts_cs_mchow) is a Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He teaches courses largely in the undergraduate curriculum including the second course in the major sequence, Web Programming, Music Apps on the iPad, and Introduction to Computer Security. He was also a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World (2011 and 2012), DEF CON 19 (2011), the Design Automation Conference (2011), Intel, and the SOURCE Conference (Boston 2013). Ming's projects in information security include building numerous CTF challenges, Internet investigations, HTML5 and JavaScript security, and Android forensics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 2013 - Joint Meeting with [http://www.meetup.com/Boston-cloud-services/ Boston Cloud Services]''' &lt;br /&gt;
&lt;br /&gt;
When: Tuesday, September 10, 6 pm&lt;br /&gt;
&lt;br /&gt;
Location: Microsoft NERD Center ''(not our usual location)''&lt;br /&gt;
&lt;br /&gt;
'''Note: This is a joint meeting. Please register at [http://www.meetup.com/Boston-cloud-services/ the Boston Cloud Services meetup page] if you plan to attend.'''&lt;br /&gt;
&lt;br /&gt;
There will be two presentations at this meeting:&lt;br /&gt;
&lt;br /&gt;
Topic: '''People Centric Security (PCS)'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Nick Stamos'''&lt;br /&gt;
&lt;br /&gt;
People Centric Security (PCS) is a new security model, presented as part of Gartner's Maverick Research 2 year ago. PCS is well suited for Cloud Business/Consumer services such as Dropbox, Google Drive, SkyDrive, etc. PCS enables users to have what they desire, and provides enterprises what they require for data governance and compliance. Nick Stamos co-founded his fourth company, nCrypted Cloud in July of 2012. His past startups include Verdasys, Phase Forward (IPO FY2004, $685M Oracle Acquisition 2010), and Amulet. He studied at Tufts University where he received a BSEE and MSEE.&lt;br /&gt;
&lt;br /&gt;
Topic: '''SSL Certs'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
Practical experiences with issuing and risk assessing SSL certs for enterprise applications on a cloud provider: who creates the CSR, how do you protect the private key on the cloud server, certs on cloud provider managed load balancers vrs 3rd party managed app servers, roles and responsibilities of cloud IT, 3rd party developer IT, enterprise IT and service providers. Jim Weiler is Application Security Architect at Starwoods Hotels and the Chapter Leader of OWASP Boston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July 2013 - Doubleheader!'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 10, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Topic: '''RailsGoat'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Ken Johnson'''&lt;br /&gt;
&lt;br /&gt;
Abstract: While working to secure rails applications in a truly Agile development environment, it became clear that the Rails and Ruby ecosystem needed attention from the security community in the form of free and open training, and the events that have transpired within the last few months have only reinforced that belief. [http://railsgoat.cktricky.com/ RailsGoat] is an attempt to bring attention to both the problems that most frequently occur in Rails as well as the solutions for remediation. To accomplish this, we've built a vulnerable Rails application that aligns with the OWASP Top 10 and can be used as a training tool for Rails-based development shops.&lt;br /&gt;
&lt;br /&gt;
Topic: '''PhoneGap on Android'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Jack Mannino'''&lt;br /&gt;
&lt;br /&gt;
Abstract: PhoneGap is a widely used framework that allows developers to rapidly build cross-platform mobile applications using HTML5, JavaScript, and CSS. Using PhoneGap plugins, developers can call native platform APIs from browser-like applications using JavaScript. This approach introduces vulnerabilities that are not typically as prevalent within native Android applications, warranting a fresh look at the way we view mobile applications. In this presentation, we will take a deep look at the Android implementation of the framework and we will examine the overall attack surface for applications. Real-world examples of vulnerable applications will be demonstrated as well in order to provide context, entertainment, and enjoyment.&lt;br /&gt;
&lt;br /&gt;
About the Speakers:&lt;br /&gt;
&lt;br /&gt;
Ken Johnson is the former Manager of LivingSocial.com's application security team where he built their security program before leaving for his true home as the CTO of nVisium Security, a VA-based application security company. Ken is the primary developer of the Web Exploitation Framework and contributes to other open source application security projects as often as time permits. He has spoken at AppSec DC 2010 and 2012, OWASP NoVA and Phoenix chapters, Northern Virginia Hackers Association (NoVAH) and is a contributor to the Attack Research team.&lt;br /&gt;
&lt;br /&gt;
Jack Mannino is the CEO of nVisium Security, a VA-based application security company. At nVisium, he helps to ensure that large corporations, government agencies, and software startups have the tools they need to build and maintain successful security initiatives. He is an active Android security researcher/tinkerer, and has a keen interest in identifying security issues and trends on a large scale. Jack is a leader and founder of the OWASP Mobile Security Project. He is the lead developer for the OWASP GoatDroid project, and is the chairman of the OWASP Northern Virginia chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''June 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''We see the future…and it isn’t pretty'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Andrea Mulligan, Sr. Director at Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
In this session Andrea presents research findings from the State of Software Security Report, which offers a before the breach look at security by examining the flaws commonly found in applications of all kinds. She will also examine what the research findings mean for security, predict how these flaws could cause history to repeat itself, and discuss how security pros can help change the future. &lt;br /&gt;
&lt;br /&gt;
 '''May 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Systems Thinking + Web Security'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Akamai'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Akamai will present on ‘Systems Thinking + Web Security’. There will also be an audience review exercise facilitated by the Akamai presenters.  This is a great chance to hear some interesting perspectives on web security from Akamai, who handles about one third of all internet traffic.&lt;br /&gt;
&lt;br /&gt;
 '''April 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Go Fast. Be Secure: Effectively Govern the Use of Open Source Components Throughout the SDLC'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Sonotype'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
* Open Source Software (OSS) Component supply chain complexities and realities. Open source is constantly changing and knowing the version in your software, as well as the current version history of the component (how do you show an auditor you are using a current version) is important. &lt;br /&gt;
* Open Source Consumption Patterns from the Central Repository. Which versions are the most popular can tell you which versions are the most stable, useful, secure etc.&lt;br /&gt;
* OWASP Top 10 (A9) - Using Components with Known Vulnerabilities. To decide on the risk of OSS components with vulnerabilities, you need to know the vulnerabilities, their severity and which components they occur in as well as where in the code dependency tree they are. &lt;br /&gt;
* OSS Security, Quality and License policies must be woven into the development process. Knowing the number and type of open source licenses in your software can be important to the legal standing of your code and if it conflicts with any corporate standards. The licensing is also important in order to know the restrictions on changing the software.&lt;br /&gt;
* OSS Component Policy Examples&lt;br /&gt;
* Example Application Compositions Reports&lt;br /&gt;
* Example Use cases IDE, CI, repository, production applications&lt;br /&gt;
* Discussion&lt;br /&gt;
&lt;br /&gt;
About Sonatype:&lt;br /&gt;
&lt;br /&gt;
Sonatype operates the Central Repository, the industry's primary source for open-source components, housing more than 400,000 components and serving more than five billion requests per year from more than 60,000 organizations. The company has been a pioneer in component-based software development since its founding by Jason van Zyl, the creator of the Apache Maven build management system and the Central Repository. &lt;br /&gt;
&lt;br /&gt;
 '''March 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''What is BSIMM?'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Nabil Hannan'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Nabil is Director of Vulnerability Assessments and Managing Consultant at Cigital.&lt;br /&gt;
 &lt;br /&gt;
The purpose of the BSIMM is to quantify the activities carried out by real software security initiatives. BSIMM is a study of the secure development practices of over 50 organizations, analyzed along the dimensions that were found in the data, not along preconceived ideas of what secure development should be.  &lt;br /&gt;
&lt;br /&gt;
BSIMM describes the work of 974 software security group members working with a satellite of 2039 people to secure the software developed by 218,286 developers. &lt;br /&gt;
&lt;br /&gt;
The BSIMM describes 111 activities that any organization can put into practice. The activities are described in twelve practices grouped into four domains. Associated with each activity is an objective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''February 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''BroBot'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Eric Kobrin, Akamai'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Eric Kobrin is a Senior Security Architect in the Infosec organization of Akamai Technologies, the global leader in Cloud-based application acceleration and content delivery. Eric has been involved in Software Architecture for over 15 years, having worked at such companies and IBM, Velocitude and eDiets.com. He has a passion for programming languages, security, and software performance and has worked in all layers of the software stack from hypervisors to complex servers and web applications. Eric's works have been published, presented at international conferences and patented.&lt;br /&gt;
 &lt;br /&gt;
His presentation will provide an analysis of the BroBot DDOS attacks, including discussion of:&lt;br /&gt;
&lt;br /&gt;
* Vulnerable system discovery&lt;br /&gt;
* Zombie compromise&lt;br /&gt;
* Control structure&lt;br /&gt;
* Attack traffic&lt;br /&gt;
* Mitigation steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''January 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Third-Party Application Analysis: Best Practices and Lessons Learned'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Chad Holmes, Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Chad Holmes will present details of the work Veracode has been doing with their 3rd Party program, discuss the technical and business challenges that have arisen during that time and lead a discussion on what team members can do to help drive adoption of security best practices across their vendor community.&lt;br /&gt;
&lt;br /&gt;
The flow of the presentation is designed to drive discussion within an audience – both from a technical and business perspective with some anecdotal stories. Chad wants this to be an interactive discussion so he’ll have questions and you should bring yours I’ve already sent him some.  The order of the presentation is:&lt;br /&gt;
&lt;br /&gt;
·         Adoption rates of externally developed software&lt;br /&gt;
&lt;br /&gt;
·         The risk within those apps&lt;br /&gt;
&lt;br /&gt;
·         Some deeper stats on what “3rd party” really means (total outsourcing/total COTS produced/open source/imported libraries/etc)&lt;br /&gt;
&lt;br /&gt;
·         Some raw data about our experiences (to show this is based on a large sample size rather than “Look how awesome Veracode is!”)&lt;br /&gt;
&lt;br /&gt;
·         Challenges that will be faced (business, intellectual property, policy, analysis capabilities, etc)&lt;br /&gt;
&lt;br /&gt;
·         Best Practices for high rates of adoption&lt;br /&gt;
&lt;br /&gt;
·         Lessons Learned and Recommendations&lt;br /&gt;
&lt;br /&gt;
Chad Holmes has over 10 years of software development and application security experience. During his time at Veracode, Chad has lead the redesign and execution of the third-party analysis process to allow for a more streamlined approach while still addressing common ISV intellectual property concerns. In addition to his third-party analysis responsibilities, Chad's previous work as a Security Program Manager has lead to the successful roll out and improvement of multiple corporate application security groups.&lt;br /&gt;
&lt;br /&gt;
 '''June 2012'''&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker '''Will Vandevanter - Rapid 7'''&lt;br /&gt;
&lt;br /&gt;
'''Fingerprinting web applications of all kinds'''&lt;br /&gt;
&lt;br /&gt;
This turbo talk will introduce a new Metasploit module that fingerprints &amp;quot;known&amp;quot; web applications, attempts the default credentials for the application, and runs an associated exploit or authenticated access module if applicable. Some example fingerprints in the database target common enterprise web applications including Microsoft products (Outlook Web Access, Sharepoint), printers (Xerox Document Centre), security cameras, routers, and others. &lt;br /&gt;
&lt;br /&gt;
Will Vandevanter is a senior penetration tester and researcher at Rapid7. His focus interests include web application security and secure code. He has previously spoken at Defcon, SOURCE, BSides LV, and other conferences. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 '''May 31 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Jobspring, Boston. 545 Boylston st. &lt;br /&gt;
&lt;br /&gt;
Speaker - '''Glenn Gramling, Vice President, Cenzic'''&lt;br /&gt;
&lt;br /&gt;
“Cloudy with a Chance of Hack”&lt;br /&gt;
&lt;br /&gt;
Cloud computing is a cost effective and efficient way for enterprises to automate their processes. However organizations need to be aware of the pitfalls of the many cloud solutions out there - one of the main being security. Most cloud applications were built for ease of use and without security necessarily in mind. Companies need to be asking their solution providers about the security measures used in developing the application and get an independent verification to make sure there are no gaping holes. With over 75% of attacks occurring through the Web, any attack through these applications can lead to leakage of confidential information and embarrassment. In this session, we'll give attendees tips and tricks to prepare them for the potential of &amp;quot;stormy weather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Glenn Gramling is responsible for global sales and business development for Cenzic’s  application security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''April 11, 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker - '''David Eoff, Senior Product Marketing Manager, HP Enterprise Security'''&lt;br /&gt;
&lt;br /&gt;
David is a Senior Product Marketing Manager, within the Enterprise Security Products division of HP focused on Fortify application security. His 18+ years of background in software and hardware enterprise marketing provides a solid foundation for his marketing of the HP security solutions. &lt;br /&gt;
 &lt;br /&gt;
Prior to joining Fortify in 2009 and being acquired by HP, David ran Firewall and IPS marketing for the Security division of Nokia Corporation. In addition, he has held multiple positions in product marketing, product management, channel marketing and sales while working for Oracle, EMC, Legato, BMC Software and several start-ups.&lt;br /&gt;
&lt;br /&gt;
Topic - '''Gray, the New Black:  Gray-Box Vulnerability Testing'''&lt;br /&gt;
&lt;br /&gt;
Over the years, two key techniques have emerged as the most effective for finding security vulnerabilities in software:  Dynamic Application Security Testing (DAST) and Static Application Security Testing (SAST).  While DAST and SAST each possess unique strengths, the “Holy Grail” of security testing is thought to be “hybrid” – a technique that combines and correlates the results from both testing methods, maximizing the advantages of each. Until recently, however, a critical element has been missing from first generation hybrid solutions:  information about the inner workings and behavior of applications undergoing DAST and SAST analysis.&lt;br /&gt;
 &lt;br /&gt;
This presentation will introduce you to the next generation of hybrid security analysis – what it is, how it works, and the benefits it offers.  It will also address (and dispel) the claims against hybrid, and leave you with a clear understanding of how the new generation of hybrid will enable organizations to resolve their most critical software security issues faster and more cost-effectively than any other available analysis technology.&lt;br /&gt;
&lt;br /&gt;
 '''March 8, 2012, with the Boston Security Meetup group'''&lt;br /&gt;
&lt;br /&gt;
Location - [http://maps.google.com/maps?q=Jobspring+Partners,+Boylston+Street,+Boston,+MA&amp;amp;hl=en&amp;amp;sll=42.362243,-71.081628&amp;amp;sspn=0.019549,0.037594&amp;amp;oq=jobspring&amp;amp;t=v&amp;amp;hq=Jobspring+Partners,&amp;amp;hnear=Boylston+St,+Boston,+Massachusetts&amp;amp;z=17 JobSpring, Boylston St.]&lt;br /&gt;
&lt;br /&gt;
Topic - '''Corporate Espionage for Dummies: The Hidden Threat of Embedded Web Servers'''&lt;br /&gt;
&lt;br /&gt;
Speaker - VP for Security Research at ZScaler, along with other speakers at the security meetup.&lt;br /&gt;
 &lt;br /&gt;
Today, everything from kitchen appliances to television sets come with an IP address. Network connectivity for various hardware devices opens up exciting opportunities. Forgot to lower the thermostat before leaving the house? Simply access it online. Need to record a show? Start the DVR with a mobile app. While embedded web servers are now as common as digital displays in hardware devices, sadly, security is not. What if that same convenience exposed photocopied documents online or allowed outsiders to record your telephone conversations? A frightening thought indeed.&lt;br /&gt;
 &lt;br /&gt;
Software vendors have been forced to climb the security learning curve. As independent researchers uncovered embarrassing vulnerabilities, vendors had little choice but to plug the holes and revamp development lifecycles to bake security into products. Vendors of embedded web servers have faced minimal scrutiny and as such are at least a decade behind when it comes to security practices. Today, network connected devices are regularly deployed with virtually no security whatsoever.&lt;br /&gt;
 &lt;br /&gt;
The risk of insecure embedded web servers has been amplified by insecure networking practices. Every home and small business now runs a wireless network, but it was likely set up by someone with virtually no networking expertise. As such, many devices designed only for LAN access are now unintentionally Internet facing and wide open to attack from anyone, regardless of their location.&lt;br /&gt;
 &lt;br /&gt;
Leveraging the power of cloud based services, Zscaler spent several months scanning large portions of the Internet to understand the scope of this threat. Our findings will make any business owner think twice before purchasing a 'wifi enabled' device. We'll share the results of our findings, reveal specific vulnerabilities in a multitude of appliances and discuss how embedded web servers will represent a target rich environment for years to come. &lt;br /&gt;
&lt;br /&gt;
 '''December 13, 2011, 6:30, Microsoft NERD, Cambridge, Horace Mann Room'''&lt;br /&gt;
&lt;br /&gt;
'''Jeremiah Grossman – Founder and CTO WhiteHat Security'''&lt;br /&gt;
 &lt;br /&gt;
Directions: http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx&lt;br /&gt;
&lt;br /&gt;
 '''September 14 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Dinis Cruz   -  OWASP O2 Platform'''&lt;br /&gt;
&lt;br /&gt;
The O2 Platform is focused on automating application security knowledge and workflows. It is a library of scriptable objects specifically designed for developers and security consultants to be able to perform quick, effective and thorough source code-driven application security reviews (blackbox + whitebox). &lt;br /&gt;
&lt;br /&gt;
 '''September 7 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Adriel Desautels –  Differences between Penetration Testing and Vulnerability Scanning'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July  2011'''&lt;br /&gt;
&lt;br /&gt;
'''Anurag Agarwal, the founder of MyAppSecurity'''&lt;br /&gt;
&lt;br /&gt;
'''Session 1 - Managing Risk with Threat Modeling''' &lt;br /&gt;
Threat Modeling can help by guiding the Application Development Teams to ensure your Security Policies get properly coded into the Applications at time of Development.  By creating pre-approved methods of coding for your development teams, and applying them in a repeatable and scalable process, you can assist your development teams in building a secure application easily and effortlessly.&lt;br /&gt;
&lt;br /&gt;
'''Session 2 - False Positive, False Negative and False Sense of Security''' &lt;br /&gt;
This interactive session will talk about the pros and cons of using black box testing tools and discuss their effectiveness in building a mature software security program. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday June 2'''&lt;br /&gt;
&lt;br /&gt;
Location - '''Microsoft NERD''' - http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx &lt;br /&gt;
&lt;br /&gt;
'''Topic - Bringing Sexy Back: Defensive Measures That Actually Work''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Paul Asadoorian, Founder &amp;amp;amp; CEO, PaulDotCom Enterprises &lt;br /&gt;
&lt;br /&gt;
There is a plethora of information available on how to break into systems, steal information, and compromise users. As a penetration tester, I have performed testing on a regular basis that reveals severe security weaknesses in several organizations, and many of my peers have reported on the same. However, once you &amp;quot;own&amp;quot; the network and report on how you accomplished your goals, now what? Sure, we make defensive recommendations, but consistently it has been proven that security can be bypassed. Not enough focus is given to what works defensively. We have a lot of technology at our disposal: firewalls, intrusion detection, log correlation, but it provides little protection from today's threats and is often not implemented effectively. This talk will focus on taking an offensive look at defense. Applying techniques that are simple, yet break the mold of traditional defensive measures. We will explore setting up &amp;quot;traps&amp;quot; for attackers, slowing them down with simple scripts, using honeypots, planting bugs, and most importantly tying these methods to &amp;quot;enterprise security&amp;quot;. This talk will also include real-world examples of the techniques in action from a live, heavily attacked site. Topics will include: &lt;br /&gt;
&lt;br /&gt;
*Using wireless “attacks” on the attackers&lt;br /&gt;
*Implementing the Metasploit Decloak engine to find the attackers&lt;br /&gt;
*Setting traps to detect web application attacks&lt;br /&gt;
*Integrating results into your enterprise log management tool&lt;br /&gt;
&lt;br /&gt;
The goal of this talk is to make defense “sexy”… &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian is currently the &amp;quot;Product Evangelist&amp;quot; for Tenable Network Security, where he showcases vulnerability scanning and management through blogs, podcasts and videos. Paul is also the founder of PaulDotCom, an organization centered around the award winning &amp;quot;PaulDotCom Security Weekly&amp;quot; podcast that brings listeners the latest in security news, vulnerabilities, research and interviews with the security industry's finest. Paul has a background in penetration testing, intrusion detection, and is the co-author of &amp;quot;WRT54G Ultimate Hacking&amp;quot;, a book dedicated to hacking Linksys routers. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday May 26'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
'''Topic - OWASP Top 10 issue #4 – Insecure Direct Object Reference''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels and President of OWASP Boston &lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss threat models, risks and various remediations of issue #4 in the 2010 OWASP Top 10 – Insecure Direct Object References. &lt;br /&gt;
&lt;br /&gt;
'''Topic - A Web-Application Architecture for Regulatory Compliant Cloud Computing''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Arshad Noor, StrongAuth &lt;br /&gt;
&lt;br /&gt;
The emergence of cloud-computing as an alternative deployment strategy for IT systems presents many opportunities, yet challenges traditional notions of data-security. The fact that data-security regulations are developing teeth, leaves information technology professionals perplexed on how to take advantage of cloud-computing while proving compliance to regulations for protecting sensitive information. &lt;br /&gt;
&lt;br /&gt;
This presentation presents an architecture for building the next generation of web-applications. This architecture allows you to leverage emerging technologies such as cloud-computing, cloud-storage and enterprise key-management (EKM) to derive benefits such as lower costs, faster time-to-market and immense scalability with smaller investments - while proving compliance to PCI-DSS, HIPAA/HITECH and similar data-security regulations. &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Arshad Noor is the CTO of StrongAuth, Inc, a Silicon Vally-based company that specializes in enterprise key management. He is the designer and lead-developer of StrongKey, the industry's first open-source Symmetric Key Management System, and the KeyAppliance - the industry's first appliance combining encryption, tokenization, key-management and a cryptographic hardware module at an unprecedented value. He has written many papers and spoken at many forums on the subject of encryption and key-management over the years. &lt;br /&gt;
&lt;br /&gt;
 ''' CANCELLED   ''' &lt;br /&gt;
&lt;br /&gt;
'''Topic – Secure Application design and Coding''' -- CANCELLED &lt;br /&gt;
&lt;br /&gt;
Presenter - Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
'''Speaker Bio ''' &lt;br /&gt;
&lt;br /&gt;
 '''April 2011'''&lt;br /&gt;
&lt;br /&gt;
Ed Adams Security Innovation -- the new OWASP Exams Project and the work being done by the OWASP Academies Working Group &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2011'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
Owning the world, one mobile app at a time, and web services pen testing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Febrary 2011'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO of Safelight Security - &lt;br /&gt;
&lt;br /&gt;
Security Leadership series: Delivering a successful security presentation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2010'''&lt;br /&gt;
&lt;br /&gt;
Application Architecture Security Assessment - Second session &lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2010'''&lt;br /&gt;
&lt;br /&gt;
Open SAMM – Software Assurance Maturity Model &lt;br /&gt;
&lt;br /&gt;
Shakeel Tufail is the Federal Practice Manager at Fortify, an HP company. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors Overview: In this highly interactive two-part workshop, Rob Cheyne of Safelight Security will show you the basics of conducting a real-world architecture &amp;amp;amp; design review. This workshop draws from Safelight's Security Architecture Fundamentals training course, a two-day course frequently used to teach Fortune 500 companies how to look at their system architectures from both the hacker's and the designer’s point of view. &lt;br /&gt;
&lt;br /&gt;
 '''July 2010'''&lt;br /&gt;
&lt;br /&gt;
Lightning Talk – Rob Cheyne, CEO Safelight Security Advisors In this installment of the Safelight lightning talks series, Rob will present the basics of a Cross-site Request Forgery (CSRF). &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Drive-by Pharming with MonkeyFist &lt;br /&gt;
&lt;br /&gt;
Joey Peloquin - Director of Application Security, Fishnet Security &lt;br /&gt;
&lt;br /&gt;
 '''June 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - topic to be announced &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Ryan Barnett The Web Hacking Incident Database (WHID) is a Web Application Security Consortium project dedicated to maintaining a list of web applications related security incidents. Ryan Barnett is director of application security research at Breach Security where he leads Breach Security Labs. &lt;br /&gt;
&lt;br /&gt;
 '''May 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - SQL Injection &lt;br /&gt;
&lt;br /&gt;
Vinnie Liu - Data Exposure, New Approaches to Open Source Intelligence Techniques, and Incident Handling &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2010'''&lt;br /&gt;
&lt;br /&gt;
Dan Hestad Security Innovation Dan will be talking about his experiences with PCI and web applications, and answering questions about do's and don'ts of acceptable PCI practices in web applications. &lt;br /&gt;
&lt;br /&gt;
 '''March 2010'''&lt;br /&gt;
&lt;br /&gt;
Zack Lanier - Disclosure Samsara, or &amp;quot;the endless vulnerability disclosure debate&amp;quot; &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.html &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.pdf (very large PDF) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne of Safelight Security Advisors; New Technology, Same Old Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2010 at Microsoft NERD, Cambridge'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 Technologies &lt;br /&gt;
&lt;br /&gt;
 '''December 2009'''&lt;br /&gt;
&lt;br /&gt;
Eric Bender, Cenzic &lt;br /&gt;
&lt;br /&gt;
 '''November 2009'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels - Web Application Vulnerability Scanners &lt;br /&gt;
&lt;br /&gt;
Mush Hakhinian, Leader, Application Security Practice, IntraLinks - Secure coding with no money down using SONAR: unleashing the power of open-source code analysis tools &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2009'''&lt;br /&gt;
&lt;br /&gt;
Paul Schofield, Senior Security Engineer, Imperva - From Rivals to BFF: WAF &amp;amp;amp; VA Unite &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2009 at CORE Technologies, Boston'''&lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian, Pauldotcom.com &lt;br /&gt;
&lt;br /&gt;
Alex Horan, CORE Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2009'''&lt;br /&gt;
&lt;br /&gt;
Joey Peloquin, Fishnet Security, Secure SDLC: The Good, the Bad and the Ugly [http://www.owasp.org/images/4/48/SecureSDLC-GoodBadUgly.pdf presentation pdf] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2009'''&lt;br /&gt;
&lt;br /&gt;
Sabha Kazerooni, Security Compass - Exploit Me tools; Framework Level Threat Analysis &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5a/Security_Compass_Exploilt_Me.pdf ExploitMe Document] &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/e/ef/Security_Compass_Framework-level_Threat_Analysis.pdf Framework Level Threat Analysis document] &lt;br /&gt;
&lt;br /&gt;
Meeting Pizza Sponsor - Arcot &lt;br /&gt;
&lt;br /&gt;
Arcot is a leader in online fraud prevention, strong authentication and eDocument security. Arcot's solutions are easily deployed, low-cost and extremely scalable, allowing organizations to transparently protect their users from fraud without changing user behavior or requiring expensive hardware. &lt;br /&gt;
&lt;br /&gt;
Arcot can be contacted thru Michael Kreppein, michael.kreppein@arcot.com, 617-467-5200 &lt;br /&gt;
&lt;br /&gt;
 '''December 2008'''&lt;br /&gt;
&lt;br /&gt;
Brian Holyfield, Gothem Digital Science &lt;br /&gt;
&lt;br /&gt;
Tamper Proofing Web Applications http://www.gdssecurity.com/l/b/2008/12/04/ &lt;br /&gt;
&lt;br /&gt;
 '''June 2008'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman; Founder and CTO, Whitehat Security &lt;br /&gt;
&lt;br /&gt;
Appetizer - Hacking Intranets from the Outside (Just when you thought your network was safe) Port scanning with JavaScript &lt;br /&gt;
&lt;br /&gt;
Main Topic - Business Logic Flaws: How they put your Websites at Risk &lt;br /&gt;
&lt;br /&gt;
 '''March 2008'''&lt;br /&gt;
&lt;br /&gt;
Chris Eng; Senior Director, Security Research, Veracode &lt;br /&gt;
&lt;br /&gt;
Description – Attacking crypto in web applications &lt;br /&gt;
&lt;br /&gt;
 '''December 2007'''&lt;br /&gt;
&lt;br /&gt;
Scott Matsumoto; Principal Consultant, Cigital &lt;br /&gt;
&lt;br /&gt;
Description – You Say Tomayto and I Say Tomahto – Talking to Developers about Application Security &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/5/5b/BostonOWASP200712-Cigital.pdf Cigital Presentation] &lt;br /&gt;
&lt;br /&gt;
 '''November 2007'''&lt;br /&gt;
&lt;br /&gt;
Tom Mulvehill Ounce Labs &lt;br /&gt;
&lt;br /&gt;
Description – Tom will share his knowledge and expertise on implementing security into the software development life cycle. This presentation will cover how to bring practicality into secure software development. Several integration models will be explored as well as solutions for potential obstacles &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/f/f8/Ounce_OWASP_07NOV07ppt.zip Ounce presentation] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2007'''&lt;br /&gt;
&lt;br /&gt;
George Johnson, Principal Software Engineer EMC; CISSP &lt;br /&gt;
&lt;br /&gt;
An Introduction to Threat Modeling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2007'''&lt;br /&gt;
&lt;br /&gt;
Day of Worldwide OWASP 1 day conferences on the topic &amp;quot;Privacy in the 21st Century&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 '''June 2007'''&lt;br /&gt;
&lt;br /&gt;
Tool Talk - Jim Weiler - WebGoat and Crosssite Request Forgeries &lt;br /&gt;
&lt;br /&gt;
Danny Allan; Director, Security Research, Watchfire &lt;br /&gt;
&lt;br /&gt;
Topic: Exploitation of the OWASP Top 10: Attacks and Strategies &lt;br /&gt;
&lt;br /&gt;
 '''March 2007'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman, CTO Whitehat Security: Top 10 Web Application Hacks of 2006 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2007'''&lt;br /&gt;
&lt;br /&gt;
Dave Low, RSA the Security Division of EMC: encryption case studies &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2006'''&lt;br /&gt;
&lt;br /&gt;
Mike Gavin, Forrester Research: Web Application Firewalls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''June 2006'''&lt;br /&gt;
&lt;br /&gt;
Imperva - Application and Database Vulnerabilities and Intrusion Prevention &lt;br /&gt;
&lt;br /&gt;
Jim Weiler - Using Paros Proxy Server as a Web Application Vulnerability tool &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2006'''&lt;br /&gt;
&lt;br /&gt;
Dennis Hurst; SPI Dynamics: A study of AJAX Hacking &lt;br /&gt;
&lt;br /&gt;
Jim Weiler; OWASP Boston: Using Paros HTTP proxy, part 1. first meeting with all demos, no powerpoints! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2006'''&lt;br /&gt;
&lt;br /&gt;
Mateo Meucci; OWASP Italy [http://www.owasp.org/images/8/8c/Anatomy_of_2_Web_App_Testing.zip Anatomy of 2 web attacks] &lt;br /&gt;
&lt;br /&gt;
Tom Stracener; Cenzic Web Application Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2006'''&lt;br /&gt;
&lt;br /&gt;
Ron Ben Natan; Guardium CTO Database Security: Protecting Identity Information at the Source &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2006'''&lt;br /&gt;
&lt;br /&gt;
David Low, Senior Field Engineer: RSA Practical Encryption &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2005'''&lt;br /&gt;
&lt;br /&gt;
Paul Galwas, Product Manager: nCipher [http://www.owasp.org/docroot/owasp/misc/OWASP051207.ppt Enigma variations: Key Management controlled] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2005'''&lt;br /&gt;
&lt;br /&gt;
Robert Hurlbut, Independent Consultant [http://www.owasp.org/docroot/owasp/misc/OWASP_Hurlbut_ThreatModelingforWebApplicaitons.zip Threat Modeling for web applications] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2005'''&lt;br /&gt;
&lt;br /&gt;
Prateek Mishra, Ph.D. Director, Security Standards and Strategy: Oracle Corp Chaiman of the OASIS Security Services (SAML) Technical Committee - [http://www.owasp.org/docroot/owasp/misc/Federation-Introduction-Overview-01.ppt Identity Federation&amp;amp;nbsp;: Prospects and Challenges] &lt;br /&gt;
&lt;br /&gt;
Ryan Shorter, Sr. System Engineer: Netcontinuum - Application Security Gateways &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2005'''&lt;br /&gt;
&lt;br /&gt;
Dr. Herbert Thompson, Chief Security Strategist: SecurityInnovation - How to Break Software Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''July 2005'''&lt;br /&gt;
&lt;br /&gt;
Mark O'Neill, CTO: Vordel - [http://www.owasp.org/docroot/owasp/misc/MarkOneill.pdf Giving SOAP a REST? A look at the intersection of Web Application Security and Web Services Security] &lt;br /&gt;
&lt;br /&gt;
 '''June 2005'''&lt;br /&gt;
&lt;br /&gt;
Arian Evans, National Practice Lead, Senior Security Engineer: Fishnet Security [http://www.owasp.org/conferences/appsec2005dc/schedule.html Overview of Application Security Tools] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2005'''&lt;br /&gt;
&lt;br /&gt;
Patrick Hynds, CTO: Critical Sites - [http://www.owasp.org/docroot/owasp/misc/Passwords-Keys_to_the_Kingdom_Dev_V1.ppt Passwords - Keys to the Kingdom] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2005'''&lt;br /&gt;
&lt;br /&gt;
Jonathan Levin - [http://www.owasp.org/docroot/owasp/misc/JLevinRandoms.pdf Of Random Numbers] &lt;br /&gt;
&lt;br /&gt;
Jothy Rosenberg, Founder and CTO: Service Integrity - [http://www.owasp.org/docroot/owasp/misc/JothyRWebSvcsSec.ppt Web Services Security] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2005'''&lt;br /&gt;
&lt;br /&gt;
Joe Stagner: Microsoft Let's talk about Application Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Feb 2005'''&lt;br /&gt;
&lt;br /&gt;
Application Security Inc. PowerPoint slides for the [http://www.owasp.org/docroot/owasp/misc/Anatomy+of+an+Attack.ppt Anatomy of a Database Attack.]&lt;br /&gt;
&lt;br /&gt;
== Local Chapter Information ==&lt;br /&gt;
&lt;br /&gt;
To find out more about the Boston chapter, just join the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. &lt;br /&gt;
&lt;br /&gt;
The chapter shipping/mailing address is: &lt;br /&gt;
&lt;br /&gt;
OWASP Boston &amp;lt;br /&amp;gt;&lt;br /&gt;
35 Wachusett Dr &amp;lt;br /&amp;gt;&lt;br /&gt;
Lexington, MA 02421 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Reviews_of_security_podcasts Reviews of security podcasts]&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/2017_BASC_Homepage Boston Application Security Conference 2017] &lt;br /&gt;
&lt;br /&gt;
[[2016 BASC Homepage|Boston Application Security Conference 2016]]&lt;br /&gt;
&lt;br /&gt;
[[2015 BASC Homepage|Boston Application Security Conference 2015]]&lt;br /&gt;
&lt;br /&gt;
[[2014 BASC Homepage|Boston Application Security Conference 2014]]&lt;br /&gt;
&lt;br /&gt;
[[2013 BASC Homepage|Boston Application Security Conference 2013]]&lt;br /&gt;
&lt;br /&gt;
[[2012 BASC Homepage|Boston Application Security Conference 2012]] &lt;br /&gt;
&lt;br /&gt;
[[2011 BASC Homepage|Boston Application Security Conference 2011]] &lt;br /&gt;
&lt;br /&gt;
[[2010 BASC Homepage|Boston Application Security Conference 2010]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Boston OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
'''President''' &lt;br /&gt;
&lt;br /&gt;
- [mailto:jim.weiler@owasp.org Jim Weiler] 781 356 0067 &lt;br /&gt;
&lt;br /&gt;
'''Board of Directors''' &lt;br /&gt;
&lt;br /&gt;
* [mailto:lindaleigh.aberdale@owasp.org LindaLeigh Aberdale]&lt;br /&gt;
* [mailto:mark.arnold@owasp.org Mark Arnold] &lt;br /&gt;
* [mailto:tom.conner@owasp.org Tom Conner] &lt;br /&gt;
* [mailto:mike.perez@owasp.org Mike Perez]&lt;br /&gt;
* [mailto:roy.wattanasin@owasp.org Roy Wattanasin]&lt;br /&gt;
* [mailto:pedro.marcano@owasp.org Pedro Marcano]&lt;br /&gt;
* [mailto:Mark.Schlepphorst@owasp.org Mark Schlepphorst] &lt;br /&gt;
* [mailto:Ori.Zigindere@owasp.org Ori Zigindere] &lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
[[Category:Boston]] &lt;br /&gt;
[[Category:OWASP_Chapter]] &lt;br /&gt;
[[Category:Massachusetts]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247072</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247072"/>
				<updated>2019-02-03T21:55:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are one of two types of HTML elements on a web page. They are either an &amp;lt;image&amp;gt; or a &amp;lt;script&amp;gt; element.  The original tags were only image elements that specified a 1 by 1 image, so they were called pixel tags. The term 'pixel' is now used to mean either image or javascript tags. When discussing tags, and someone says a pixel, you may need to determine if that term is used in the general sense meaning both script and image tags, or whether they are referring to an image element and not a script element. The reason for them is to collect data on the web user attributes, actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
A single pixel image element was used because the image source would be the 3rd party tag vendor, so the browser would create a request to the vendor which could include any vendor cookies, that could then be used to track the user, because the referer header in the request would have the web page URL that the user was on.&lt;br /&gt;
&lt;br /&gt;
We are only concerned with script tags in this document.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 (see magecart references at the end of this article) and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
       &amp;lt;body&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
       &amp;lt;body&amp;gt;&lt;br /&gt;
         ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
         &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
         &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
       &amp;lt;body&amp;gt;&lt;br /&gt;
         ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
         &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
           w[l] = w[l] || [];&lt;br /&gt;
           w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
           var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
           j.async=true;&lt;br /&gt;
           j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
           f.parentNode.insertBefore(j, f);&lt;br /&gt;
         })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
         &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
     integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
     crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2017-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2017 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
       &amp;lt;body&amp;gt;&lt;br /&gt;
         ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
         &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
   &amp;lt;html&amp;gt;&lt;br /&gt;
     &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
       &amp;lt;body&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;script&amp;gt;&lt;br /&gt;
         window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
         function receiveMessage(event) {&lt;br /&gt;
           if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
             return;&lt;br /&gt;
           } else {&lt;br /&gt;
           // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
         &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
         &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
         &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
     &amp;lt;/body&amp;gt;&lt;br /&gt;
   &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete and preventive controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. A data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-ticketmaster-breach/&lt;br /&gt;
&lt;br /&gt;
https://www.clearskysec.com/magecart/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-keylogger-injection/&lt;br /&gt;
&lt;br /&gt;
https://www.zdnet.com/article/inbenta-blamed-for-ticketmaster-breach-says-other-sites-not-affected/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247071</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247071"/>
				<updated>2019-02-03T21:54:08Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: changed  reference to 2013 top 10 to 2017&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are one of two types of HTML elements on a web page. They are either an &amp;lt;image&amp;gt; or a &amp;lt;script&amp;gt; element.  The original tags were only image elements that specified a 1 by 1 image, so they were called pixel tags. The term 'pixel' is now used to mean either image or javascript tags. When discussing tags, and someone says a pixel, you may need to determine if that term is used in the general sense meaning both script and image tags, or whether they are referring to an image element and not a script element. The reason for them is to collect data on the web user attributes, actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
A single pixel image element was used because the image source would be the 3rd party tag vendor, so the browser would create a request to the vendor which could include any vendor cookies, that could then be used to track the user, because the referer header in the request would have the web page URL that the user was on.&lt;br /&gt;
&lt;br /&gt;
We are only concerned with script tags in this document.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 (see magecart references at the end of this article) and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
          w[l] = w[l] || [];&lt;br /&gt;
          w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
          var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
          j.async=true;&lt;br /&gt;
          j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
          f.parentNode.insertBefore(j, f);&lt;br /&gt;
        })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
    integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
    crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2017-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;script&amp;gt;&lt;br /&gt;
        window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
        function receiveMessage(event) {&lt;br /&gt;
          if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
            return;&lt;br /&gt;
          } else {&lt;br /&gt;
          // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete and preventive controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. A data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-ticketmaster-breach/&lt;br /&gt;
&lt;br /&gt;
https://www.clearskysec.com/magecart/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-keylogger-injection/&lt;br /&gt;
&lt;br /&gt;
https://www.zdnet.com/article/inbenta-blamed-for-ticketmaster-breach-says-other-sites-not-affected/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247070</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=247070"/>
				<updated>2019-02-03T21:50:42Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: better description of tag definition and use of term 'pixel', in first paragraph.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are one of two types of HTML elements on a web page. They are either an &amp;lt;image&amp;gt; or a &amp;lt;script&amp;gt; element.  The original tags were only image elements that specified a 1 by 1 image, so they were called pixel tags. The term 'pixel' is now used to mean either image or javascript tags. When discussing tags, and someone says a pixel, you may need to determine if that term is used in the general sense meaning both script and image tags, or whether they are referring to an image element and not a script element. The reason for them is to collect data on the web user attributes, actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
A single pixel image element was used because the image source would be the 3rd party tag vendor, so the browser would create a request to the vendor which could include any vendor cookies, that could then be used to track the user, because the referer header in the request would have the web page URL that the user was on.&lt;br /&gt;
&lt;br /&gt;
We are only concerned with script tags in this document.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 (see magecart references at the end of this article) and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
          w[l] = w[l] || [];&lt;br /&gt;
          w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
          var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
          j.async=true;&lt;br /&gt;
          j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
          f.parentNode.insertBefore(j, f);&lt;br /&gt;
        })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
    integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
    crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
      &amp;lt;body&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;script&amp;gt;&lt;br /&gt;
        window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
        function receiveMessage(event) {&lt;br /&gt;
          if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
            return;&lt;br /&gt;
          } else {&lt;br /&gt;
          // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
        &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete and preventive controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. A data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-ticketmaster-breach/&lt;br /&gt;
&lt;br /&gt;
https://www.clearskysec.com/magecart/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-keylogger-injection/&lt;br /&gt;
&lt;br /&gt;
https://www.zdnet.com/article/inbenta-blamed-for-ticketmaster-breach-says-other-sites-not-affected/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=241888</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=241888"/>
				<updated>2018-07-16T15:46:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added links to Ticketmaster breach and good explanations with actual code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete and preventive controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. A data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-ticketmaster-breach/&lt;br /&gt;
&lt;br /&gt;
https://www.clearskysec.com/magecart/&lt;br /&gt;
&lt;br /&gt;
https://www.riskiq.com/blog/labs/magecart-keylogger-injection/&lt;br /&gt;
&lt;br /&gt;
https://www.zdnet.com/article/inbenta-blamed-for-ticketmaster-breach-says-other-sites-not-affected/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241012</id>
		<title>CORS OriginHeaderScrutiny</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241012"/>
				<updated>2018-05-30T01:45:37Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: syntax corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{taggedDocument&lt;br /&gt;
| type=pls_review&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''08/16/2013'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
'''CORS''' stands for '''C'''ross-'''O'''rigin '''R'''esource '''S'''haring. &lt;br /&gt;
&lt;br /&gt;
Is a feature offering the possbility for:&lt;br /&gt;
* A web application to expose resources to all or restricted domain,&lt;br /&gt;
* A web client to make AJAX request for resource on other domain than is source domain.&lt;br /&gt;
&lt;br /&gt;
This article will focus on the role of the '''Origin''' header in the exchange between web client and web application.&lt;br /&gt;
&lt;br /&gt;
The basic process is composed of the steps below (sample HTTP resquest/response has been taken from [https://developer.mozilla.org/en-US/docs/HTTP_access_control Mozilla Wiki]):&lt;br /&gt;
&lt;br /&gt;
* '''Step 1 : Web client sends a request to get a resource from a different domain.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET /resources/public-data/ HTTP/1.1&lt;br /&gt;
Host: bar.other&lt;br /&gt;
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081130 Minefield/3.1b3pre&lt;br /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;
Accept-Language: en-us,en;q=0.5&lt;br /&gt;
Accept-Encoding: gzip,deflate&lt;br /&gt;
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
Connection: keep-alive&lt;br /&gt;
Referer: http://foo.example/examples/access-control/simpleXSInvocation.html&lt;br /&gt;
Origin: http://foo.example&lt;br /&gt;
&lt;br /&gt;
[Request Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web client tells the server its source domain using the HTTP request header &amp;quot;'''Origin'''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Step 2 : Web application response to request.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 01 Dec 2008 00:23:53 GMT&lt;br /&gt;
Server: Apache/2.0.61 &lt;br /&gt;
Keep-Alive: timeout=2, max=100&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Transfer-Encoding: chunked&lt;br /&gt;
Content-Type: application/xml&lt;br /&gt;
Access-Control-Allow-Origin: *&lt;br /&gt;
&lt;br /&gt;
[Response Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web application informs the web client of the allowed domains using the HTTP response header '''Access-Control-Allow-Origin'''.&lt;br /&gt;
The header can contains either a '*' to indicate that all domains are allowed OR a specified domain to indicate the specified allowed domain.&lt;br /&gt;
&lt;br /&gt;
* '''Step 3 : Web client process web application response.'''&lt;br /&gt;
&lt;br /&gt;
According to the CORS W3C specification, it's up to the web client (usually a browser) to determine, using the web application response HTTP header '''Access-Control-Allow-Origin''', &lt;br /&gt;
if the web client is allowed to access response data.&lt;br /&gt;
&lt;br /&gt;
== Risk ==&lt;br /&gt;
&lt;br /&gt;
''A reminder : This article will focus on the web application side because it's the only part in which we have the maximum of control.''&lt;br /&gt;
&lt;br /&gt;
The risk here is that a web client can put any value into the '''Origin''' request HTTP header in order to force web application to provide it the target resource content. &lt;br /&gt;
In the case of a Browser web client, the header value is managed by the browser but another &amp;quot;web client&amp;quot; can be used (like Curl/Wget/Burp suite/...) to change/override the &amp;quot;Origin&amp;quot; header value...&lt;br /&gt;
&lt;br /&gt;
== Countermeasure ==&lt;br /&gt;
&lt;br /&gt;
'''Option A: Use CORS authenticated request'''&lt;br /&gt;
&lt;br /&gt;
In this option, we enable authentication on the resources accessed and require that the user/application credentials be passed with the [https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Requests_with_credentials CORS requests].&lt;br /&gt;
&lt;br /&gt;
If the CORS resources exposed are classified as sensitive (and CORS exposition is mandatory) it's a good option but if the objective is only to ensure that the request originator is really &lt;br /&gt;
one of the allowed (to avoid rogue call), there somes drawback with this option, among others:&lt;br /&gt;
* The target application must manage users (or applications) credentials repositories including features like password expiry, password reset, brute force prevention, account lock/unlock,...&lt;br /&gt;
* The client application must store (in a secure way) the credentials to use,&lt;br /&gt;
* The client application must manage/configure credentials transfer in HTTP request in order that credentials are send only in case of CORS requests to target application.&lt;br /&gt;
&lt;br /&gt;
'''Option B: We can scrutiny the Origin header value on server side''' &lt;br /&gt;
&lt;br /&gt;
In this option, the objective is to work between steps 1 and 2 of the CORS HTTP requests/responses exchange process (see above).&lt;br /&gt;
&lt;br /&gt;
To achieve it, we will use JEE Web Filter that will ensure the following points for each incoming HTTP CORS requests:&lt;br /&gt;
# Have only one non empty instance of the '''origin''' header,&lt;br /&gt;
# Have only one non empty instance of the '''host''' header,&lt;br /&gt;
# The value of the origin header is present in an internal allowed domains list (white list). This check is done before step 2 of the CORS HTTP requests/responses exchange process, and the allowed domains list will be provided to the client,&lt;br /&gt;
# Cache IP of the sender for 1 hour. If the sender sends any requests with an origin domain that is not in the white list then all requests will return an HTTP 403 response (protract allowed domain guessing).&lt;br /&gt;
&lt;br /&gt;
We use the method above because it's not possible to be 100% certain that any request comes from an expected client application, since:&lt;br /&gt;
* All information of a HTTP request can be faked,&lt;br /&gt;
* It's the browser (or others tools) that send the HTTP request then the IP address that we have access to is the client IP address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#88421D&amp;quot;&amp;gt;In a Enterprise inter application communication it's possible to add a check on the client IP range. &lt;br /&gt;
&amp;quot;Business to business&amp;quot; communication offer possibility to for each part to indicate to others parts the IP range that it will &lt;br /&gt;
be used by its applications.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sample implementation: Filter class'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
import java.util.Enumeration;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.Filter;&lt;br /&gt;
import javax.servlet.FilterChain;&lt;br /&gt;
import javax.servlet.FilterConfig;&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.ServletRequest;&lt;br /&gt;
import javax.servlet.ServletResponse;&lt;br /&gt;
import javax.servlet.annotation.WebFilter;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
import net.sf.ehcache.Cache;&lt;br /&gt;
import net.sf.ehcache.CacheManager;&lt;br /&gt;
import net.sf.ehcache.Element;&lt;br /&gt;
import net.sf.ehcache.config.CacheConfiguration;&lt;br /&gt;
import net.sf.ehcache.config.PersistenceConfiguration;&lt;br /&gt;
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Sample filter implementation to scrutiny CORS &amp;quot;Origin&amp;quot; HTTP header.&amp;lt;br/&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This implementation has a dependency on EHCache API because&amp;lt;br/&amp;gt;&lt;br /&gt;
 * it use Caching for blacklisted client IP in order to enhance performance.&lt;br /&gt;
 * &lt;br /&gt;
 * Assume here that all CORS resources are grouped in context path &amp;quot;/cors/&amp;quot;.&lt;br /&gt;
 * &lt;br /&gt;
 */&lt;br /&gt;
@WebFilter(&amp;quot;/cors/*&amp;quot;)&lt;br /&gt;
public class CORSOriginHeaderScrutiny implements Filter {&lt;br /&gt;
&lt;br /&gt;
	/** Filter configuration */&lt;br /&gt;
	@SuppressWarnings(&amp;quot;unused&amp;quot;)&lt;br /&gt;
	private FilterConfig filterConfig = null;&lt;br /&gt;
&lt;br /&gt;
	/** Cache used to cache blacklisted Clients (request sender) IP address */&lt;br /&gt;
	private Cache blackListedClientIPCache = null;&lt;br /&gt;
&lt;br /&gt;
	/** Domains allowed to access to resources (white list) */&lt;br /&gt;
	private List&amp;lt;String&amp;gt; allowedDomains = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#init(FilterConfig)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(FilterConfig fConfig) throws ServletException {&lt;br /&gt;
		// Get filter configuration&lt;br /&gt;
		this.filterConfig = fConfig;&lt;br /&gt;
		// Initialize Client IP address dedicated cache with a cache of 60 minutes expiration delay for each item&lt;br /&gt;
		PersistenceConfiguration cachePersistence = new PersistenceConfiguration();&lt;br /&gt;
		cachePersistence.strategy(PersistenceConfiguration.Strategy.NONE);&lt;br /&gt;
		CacheConfiguration cacheConfig = new CacheConfiguration().memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.FIFO)&lt;br /&gt;
		.eternal(false)&lt;br /&gt;
		.timeToLiveSeconds(3600)&lt;br /&gt;
		.diskExpiryThreadIntervalSeconds(450)&lt;br /&gt;
		.persistence(cachePersistence)&lt;br /&gt;
		.maxEntriesLocalHeap(10000)&lt;br /&gt;
		.logging(false);&lt;br /&gt;
		cacheConfig.setName(&amp;quot;BlackListedClientsCacheConfig&amp;quot;);&lt;br /&gt;
		this.blackListedClientIPCache = new Cache(cacheConfig);&lt;br /&gt;
		this.blackListedClientIPCache.setName(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
		CacheManager.getInstance().addCache(this.blackListedClientIPCache);&lt;br /&gt;
		// Load domains allowed white list (hard coded here only for example)&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;http://www.html5rocks.com&amp;quot;);&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;https://www.mydomains.com&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#destroy()&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void destroy() {&lt;br /&gt;
		// Remove Cache&lt;br /&gt;
		CacheManager.getInstance().removeCache(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) &lt;br /&gt;
        throws IOException, ServletException {&lt;br /&gt;
		HttpServletRequest httpRequest = ((HttpServletRequest) request);&lt;br /&gt;
		HttpServletResponse httpResponse = ((HttpServletResponse) response);&lt;br /&gt;
		List&amp;lt;String&amp;gt; headers = null;&lt;br /&gt;
		boolean isValid = false;&lt;br /&gt;
		String origin = null;&lt;br /&gt;
		String clientIP = httpRequest.getRemoteAddr();&lt;br /&gt;
&lt;br /&gt;
		/* Step 0 : Check presence of client IP in black list */&lt;br /&gt;
		if (this.blackListedClientIPCache.isKeyInCache(clientIP)) {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 1 : Check that we have only one and non empty instance of the &amp;quot;Origin&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Origin&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Origin&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		origin = headers.get(0);&lt;br /&gt;
&lt;br /&gt;
		/* Step 2 : Check that we have only one and non empty instance of the &amp;quot;Host&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Host&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Host&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 3 : Perform analysis - Origin header is required */&lt;br /&gt;
		if ((origin != null) &amp;amp;&amp;amp; !&amp;quot;&amp;quot;.equals(origin.trim())) {&lt;br /&gt;
			if (this.allowedDomains.contains(origin)) {&lt;br /&gt;
				// Check if origin is in allowed domain&lt;br /&gt;
				isValid = true;&lt;br /&gt;
			} else {&lt;br /&gt;
				// Add client IP address to black listed client&lt;br /&gt;
				addClientToBlacklist(clientIP);&lt;br /&gt;
				isValid = false;&lt;br /&gt;
				// Add trace here&lt;br /&gt;
				// ....&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 4 : Finalize request next step */&lt;br /&gt;
		if (isValid) {&lt;br /&gt;
			// Analysis OK then pass the request along the filter chain&lt;br /&gt;
			chain.doFilter(request, response);&lt;br /&gt;
		} else {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Blacklist client&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param clientIP Client IP address&lt;br /&gt;
	 */&lt;br /&gt;
	private void addClientToBlacklist(String clientIP) {&lt;br /&gt;
		// Add client IP address to black listed client&lt;br /&gt;
		Element cacheElement = new Element(clientIP, clientIP);&lt;br /&gt;
		this.blackListedClientIPCache.put(cacheElement);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Convert a enumeration to a list&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param tmpEnum Enumeration to convert&lt;br /&gt;
	 * @return list of string or null is input enumeration is null&lt;br /&gt;
	 */&lt;br /&gt;
	private static List&amp;lt;String&amp;gt; enumAsList(Enumeration&amp;lt;String&amp;gt; tmpEnum) {&lt;br /&gt;
		if (tmpEnum != null) {&lt;br /&gt;
			return Collections.list(tmpEnum);&lt;br /&gt;
		}&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
[[Automated Audit using W3AF|W3AF]] audit tools (http://w3af.org) contains plugins to automatically audit web &lt;br /&gt;
application to check if they implements this type of countermeasure. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#088A08&amp;quot;&amp;gt;&lt;br /&gt;
It's very useful to include this type of tools into a web application development process in order to &lt;br /&gt;
perform a regular automatic first level check (do not replace an manual audit and manual audit must be also conducted regularly).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Informations links ==&lt;br /&gt;
&lt;br /&gt;
* W3C Specification : http://www.w3.org/TR/cors/&lt;br /&gt;
* Mozilla Wiki : https://developer.mozilla.org/en-US/docs/HTTP_access_control&lt;br /&gt;
* Wikipedia : http://en.wikipedia.org/wiki/Cross-origin_resource_sharing&lt;br /&gt;
* CORS Abuse : http://blog.secureideas.com/2013/02/grab-cors-light.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Attack]]&lt;br /&gt;
[[Category:Injection Attack]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241011</id>
		<title>CORS OriginHeaderScrutiny</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241011"/>
				<updated>2018-05-30T01:43:29Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: more syntax corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{taggedDocument&lt;br /&gt;
| type=pls_review&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''08/16/2013'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
'''CORS''' stands for '''C'''ross-'''O'''rigin '''R'''esource '''S'''haring. &lt;br /&gt;
&lt;br /&gt;
Is a feature offering the possbility for:&lt;br /&gt;
* A web application to expose resources to all or restricted domain,&lt;br /&gt;
* A web client to make AJAX request for resource on other domain than is source domain.&lt;br /&gt;
&lt;br /&gt;
This article will focus on the role of the '''Origin''' header in the exchange between web client and web application.&lt;br /&gt;
&lt;br /&gt;
The basic process is composed of the steps below (sample HTTP resquest/response has been taken from [https://developer.mozilla.org/en-US/docs/HTTP_access_control Mozilla Wiki]):&lt;br /&gt;
&lt;br /&gt;
* '''Step 1 : Web client sends a request to get a resource from a different domain.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET /resources/public-data/ HTTP/1.1&lt;br /&gt;
Host: bar.other&lt;br /&gt;
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081130 Minefield/3.1b3pre&lt;br /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;
Accept-Language: en-us,en;q=0.5&lt;br /&gt;
Accept-Encoding: gzip,deflate&lt;br /&gt;
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
Connection: keep-alive&lt;br /&gt;
Referer: http://foo.example/examples/access-control/simpleXSInvocation.html&lt;br /&gt;
Origin: http://foo.example&lt;br /&gt;
&lt;br /&gt;
[Request Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web client tell the server its source domain using the HTTP request header &amp;quot;'''Origin'''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Step 2 : Web application response to request.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 01 Dec 2008 00:23:53 GMT&lt;br /&gt;
Server: Apache/2.0.61 &lt;br /&gt;
Keep-Alive: timeout=2, max=100&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Transfer-Encoding: chunked&lt;br /&gt;
Content-Type: application/xml&lt;br /&gt;
Access-Control-Allow-Origin: *&lt;br /&gt;
&lt;br /&gt;
[Response Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web application informs web client of the allowed domain using the HTTP response header '''Access-Control-Allow-Origin'''.&lt;br /&gt;
The header can contains a '*' to indicate that all domain are allowed OR a specified domain to indicate the specified allowed domain.&lt;br /&gt;
&lt;br /&gt;
* '''Step 3 : Web client process web application response.'''&lt;br /&gt;
&lt;br /&gt;
According to the CORS W3C specification, it's up to the web client (usually a browser) to determine, using the web application response HTTP header '''Access-Control-Allow-Origin''', &lt;br /&gt;
if the web client is allowed to access response data.&lt;br /&gt;
&lt;br /&gt;
== Risk ==&lt;br /&gt;
&lt;br /&gt;
''A reminder : This article will focus on the web application side because it's the only part in which we have the maximum of control.''&lt;br /&gt;
&lt;br /&gt;
The risk here is that a web client can put any value into the '''Origin''' request HTTP header in order to force web application to provide it the target resource content. &lt;br /&gt;
In the case of a Browser web client, the header value is managed by the browser but another &amp;quot;web client&amp;quot; can be used (like Curl/Wget/Burp suite/...) to change/override the &amp;quot;Origin&amp;quot; header value...&lt;br /&gt;
&lt;br /&gt;
== Countermeasure ==&lt;br /&gt;
&lt;br /&gt;
'''Option A: Use CORS authenticated request'''&lt;br /&gt;
&lt;br /&gt;
In this option, we enable authentication on the resources accessed and require that the user/application credentials be passed with the [https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Requests_with_credentials CORS requests].&lt;br /&gt;
&lt;br /&gt;
If the CORS resources exposed are classified as sensitive (and CORS exposition is mandatory) it's a good option but if the objective is only to ensure that the request originator is really &lt;br /&gt;
one of the allowed (to avoid rogue call), there somes drawback with this option, among others:&lt;br /&gt;
* The target application must manage users (or applications) credentials repositories including features like password expiry, password reset, brute force prevention, account lock/unlock,...&lt;br /&gt;
* The client application must store (in a secure way) the credentials to use,&lt;br /&gt;
* The client application must manage/configure credentials transfer in HTTP request in order that credentials are send only in case of CORS requests to target application.&lt;br /&gt;
&lt;br /&gt;
'''Option B: We can scrutiny the Origin header value on server side''' &lt;br /&gt;
&lt;br /&gt;
In this option, the objective is to work between steps 1 and 2 of the CORS HTTP requests/responses exchange process (see above).&lt;br /&gt;
&lt;br /&gt;
To achieve it, we will use JEE Web Filter that will ensure the following points for each incoming HTTP CORS requests:&lt;br /&gt;
# Have only one non empty instance of the '''origin''' header,&lt;br /&gt;
# Have only one non empty instance of the '''host''' header,&lt;br /&gt;
# The value of the origin header is present in an internal allowed domains list (white list). This check is done before step 2 of the CORS HTTP requests/responses exchange process, and the allowed domains list will be provided to the client,&lt;br /&gt;
# Cache IP of the sender for 1 hour. If the sender sends any requests with an origin domain that is not in the white list then all requests will return an HTTP 403 response (protract allowed domain guessing).&lt;br /&gt;
&lt;br /&gt;
We use the method above because it's not possible to be 100% certain that any request comes from an expected client application, since:&lt;br /&gt;
* All information of a HTTP request can be faked,&lt;br /&gt;
* It's the browser (or others tools) that send the HTTP request then the IP address that we have access to is the client IP address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#88421D&amp;quot;&amp;gt;In a Enterprise inter application communication it's possible to add a check on the client IP range. &lt;br /&gt;
&amp;quot;Business to business&amp;quot; communication offer possibility to for each part to indicate to others parts the IP range that it will &lt;br /&gt;
be used by its applications.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sample implementation: Filter class'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
import java.util.Enumeration;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.Filter;&lt;br /&gt;
import javax.servlet.FilterChain;&lt;br /&gt;
import javax.servlet.FilterConfig;&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.ServletRequest;&lt;br /&gt;
import javax.servlet.ServletResponse;&lt;br /&gt;
import javax.servlet.annotation.WebFilter;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
import net.sf.ehcache.Cache;&lt;br /&gt;
import net.sf.ehcache.CacheManager;&lt;br /&gt;
import net.sf.ehcache.Element;&lt;br /&gt;
import net.sf.ehcache.config.CacheConfiguration;&lt;br /&gt;
import net.sf.ehcache.config.PersistenceConfiguration;&lt;br /&gt;
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Sample filter implementation to scrutiny CORS &amp;quot;Origin&amp;quot; HTTP header.&amp;lt;br/&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This implementation has a dependency on EHCache API because&amp;lt;br/&amp;gt;&lt;br /&gt;
 * it use Caching for blacklisted client IP in order to enhance performance.&lt;br /&gt;
 * &lt;br /&gt;
 * Assume here that all CORS resources are grouped in context path &amp;quot;/cors/&amp;quot;.&lt;br /&gt;
 * &lt;br /&gt;
 */&lt;br /&gt;
@WebFilter(&amp;quot;/cors/*&amp;quot;)&lt;br /&gt;
public class CORSOriginHeaderScrutiny implements Filter {&lt;br /&gt;
&lt;br /&gt;
	/** Filter configuration */&lt;br /&gt;
	@SuppressWarnings(&amp;quot;unused&amp;quot;)&lt;br /&gt;
	private FilterConfig filterConfig = null;&lt;br /&gt;
&lt;br /&gt;
	/** Cache used to cache blacklisted Clients (request sender) IP address */&lt;br /&gt;
	private Cache blackListedClientIPCache = null;&lt;br /&gt;
&lt;br /&gt;
	/** Domains allowed to access to resources (white list) */&lt;br /&gt;
	private List&amp;lt;String&amp;gt; allowedDomains = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#init(FilterConfig)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(FilterConfig fConfig) throws ServletException {&lt;br /&gt;
		// Get filter configuration&lt;br /&gt;
		this.filterConfig = fConfig;&lt;br /&gt;
		// Initialize Client IP address dedicated cache with a cache of 60 minutes expiration delay for each item&lt;br /&gt;
		PersistenceConfiguration cachePersistence = new PersistenceConfiguration();&lt;br /&gt;
		cachePersistence.strategy(PersistenceConfiguration.Strategy.NONE);&lt;br /&gt;
		CacheConfiguration cacheConfig = new CacheConfiguration().memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.FIFO)&lt;br /&gt;
		.eternal(false)&lt;br /&gt;
		.timeToLiveSeconds(3600)&lt;br /&gt;
		.diskExpiryThreadIntervalSeconds(450)&lt;br /&gt;
		.persistence(cachePersistence)&lt;br /&gt;
		.maxEntriesLocalHeap(10000)&lt;br /&gt;
		.logging(false);&lt;br /&gt;
		cacheConfig.setName(&amp;quot;BlackListedClientsCacheConfig&amp;quot;);&lt;br /&gt;
		this.blackListedClientIPCache = new Cache(cacheConfig);&lt;br /&gt;
		this.blackListedClientIPCache.setName(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
		CacheManager.getInstance().addCache(this.blackListedClientIPCache);&lt;br /&gt;
		// Load domains allowed white list (hard coded here only for example)&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;http://www.html5rocks.com&amp;quot;);&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;https://www.mydomains.com&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#destroy()&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void destroy() {&lt;br /&gt;
		// Remove Cache&lt;br /&gt;
		CacheManager.getInstance().removeCache(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) &lt;br /&gt;
        throws IOException, ServletException {&lt;br /&gt;
		HttpServletRequest httpRequest = ((HttpServletRequest) request);&lt;br /&gt;
		HttpServletResponse httpResponse = ((HttpServletResponse) response);&lt;br /&gt;
		List&amp;lt;String&amp;gt; headers = null;&lt;br /&gt;
		boolean isValid = false;&lt;br /&gt;
		String origin = null;&lt;br /&gt;
		String clientIP = httpRequest.getRemoteAddr();&lt;br /&gt;
&lt;br /&gt;
		/* Step 0 : Check presence of client IP in black list */&lt;br /&gt;
		if (this.blackListedClientIPCache.isKeyInCache(clientIP)) {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 1 : Check that we have only one and non empty instance of the &amp;quot;Origin&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Origin&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Origin&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		origin = headers.get(0);&lt;br /&gt;
&lt;br /&gt;
		/* Step 2 : Check that we have only one and non empty instance of the &amp;quot;Host&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Host&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Host&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 3 : Perform analysis - Origin header is required */&lt;br /&gt;
		if ((origin != null) &amp;amp;&amp;amp; !&amp;quot;&amp;quot;.equals(origin.trim())) {&lt;br /&gt;
			if (this.allowedDomains.contains(origin)) {&lt;br /&gt;
				// Check if origin is in allowed domain&lt;br /&gt;
				isValid = true;&lt;br /&gt;
			} else {&lt;br /&gt;
				// Add client IP address to black listed client&lt;br /&gt;
				addClientToBlacklist(clientIP);&lt;br /&gt;
				isValid = false;&lt;br /&gt;
				// Add trace here&lt;br /&gt;
				// ....&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 4 : Finalize request next step */&lt;br /&gt;
		if (isValid) {&lt;br /&gt;
			// Analysis OK then pass the request along the filter chain&lt;br /&gt;
			chain.doFilter(request, response);&lt;br /&gt;
		} else {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Blacklist client&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param clientIP Client IP address&lt;br /&gt;
	 */&lt;br /&gt;
	private void addClientToBlacklist(String clientIP) {&lt;br /&gt;
		// Add client IP address to black listed client&lt;br /&gt;
		Element cacheElement = new Element(clientIP, clientIP);&lt;br /&gt;
		this.blackListedClientIPCache.put(cacheElement);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Convert a enumeration to a list&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param tmpEnum Enumeration to convert&lt;br /&gt;
	 * @return list of string or null is input enumeration is null&lt;br /&gt;
	 */&lt;br /&gt;
	private static List&amp;lt;String&amp;gt; enumAsList(Enumeration&amp;lt;String&amp;gt; tmpEnum) {&lt;br /&gt;
		if (tmpEnum != null) {&lt;br /&gt;
			return Collections.list(tmpEnum);&lt;br /&gt;
		}&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
[[Automated Audit using W3AF|W3AF]] audit tools (http://w3af.org) contains plugins to automatically audit web &lt;br /&gt;
application to check if they implements this type of countermeasure. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#088A08&amp;quot;&amp;gt;&lt;br /&gt;
It's very useful to include this type of tools into a web application development process in order to &lt;br /&gt;
perform a regular automatic first level check (do not replace an manual audit and manual audit must be also conducted regularly).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Informations links ==&lt;br /&gt;
&lt;br /&gt;
* W3C Specification : http://www.w3.org/TR/cors/&lt;br /&gt;
* Mozilla Wiki : https://developer.mozilla.org/en-US/docs/HTTP_access_control&lt;br /&gt;
* Wikipedia : http://en.wikipedia.org/wiki/Cross-origin_resource_sharing&lt;br /&gt;
* CORS Abuse : http://blog.secureideas.com/2013/02/grab-cors-light.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Attack]]&lt;br /&gt;
[[Category:Injection Attack]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:CORS_OriginHeaderScrutiny&amp;diff=241009</id>
		<title>Talk:CORS OriginHeaderScrutiny</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:CORS_OriginHeaderScrutiny&amp;diff=241009"/>
				<updated>2018-05-30T01:38:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: request for clarification of some statements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;what does &amp;quot;protract allowed domain guessing&amp;quot; mean?&lt;br /&gt;
&lt;br /&gt;
I don't understand what this is trying to say - &amp;quot;It's the browser (or others tools) that send the HTTP request then the IP address that we have access to is the client IP address&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:CORS_OriginHeaderScrutiny&amp;diff=241008</id>
		<title>Talk:CORS OriginHeaderScrutiny</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:CORS_OriginHeaderScrutiny&amp;diff=241008"/>
				<updated>2018-05-30T01:36:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: Created page with &amp;quot;what does &amp;quot;protract allowed domain guessing&amp;quot; mean?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;what does &amp;quot;protract allowed domain guessing&amp;quot; mean?&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241007</id>
		<title>CORS OriginHeaderScrutiny</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CORS_OriginHeaderScrutiny&amp;diff=241007"/>
				<updated>2018-05-30T01:36:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{taggedDocument&lt;br /&gt;
| type=pls_review&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''08/16/2013'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
'''CORS''' stands for '''C'''ross-'''O'''rigin '''R'''esource '''S'''haring. &lt;br /&gt;
&lt;br /&gt;
Is a feature offering the possbility for:&lt;br /&gt;
* A web application to expose resources to all or restricted domain,&lt;br /&gt;
* A web client to make AJAX request for resource on other domain than is source domain.&lt;br /&gt;
&lt;br /&gt;
This article will focus on role of the '''Origin''' header in exchange between web client and web application.&lt;br /&gt;
&lt;br /&gt;
The basic process is composed by steps below (sample HTTP resquest/response has been taken from [https://developer.mozilla.org/en-US/docs/HTTP_access_control Mozilla Wiki]):&lt;br /&gt;
&lt;br /&gt;
* '''Step 1 : Web client send request to get resource from a different domain.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET /resources/public-data/ HTTP/1.1&lt;br /&gt;
Host: bar.other&lt;br /&gt;
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081130 Minefield/3.1b3pre&lt;br /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;
Accept-Language: en-us,en;q=0.5&lt;br /&gt;
Accept-Encoding: gzip,deflate&lt;br /&gt;
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;
Connection: keep-alive&lt;br /&gt;
Referer: http://foo.example/examples/access-control/simpleXSInvocation.html&lt;br /&gt;
Origin: http://foo.example&lt;br /&gt;
&lt;br /&gt;
[Request Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web client inform is source domain using the HTTP request header &amp;quot;'''Origin'''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Step 2 : Web application respond to request.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 01 Dec 2008 00:23:53 GMT&lt;br /&gt;
Server: Apache/2.0.61 &lt;br /&gt;
Keep-Alive: timeout=2, max=100&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Transfer-Encoding: chunked&lt;br /&gt;
Content-Type: application/xml&lt;br /&gt;
Access-Control-Allow-Origin: *&lt;br /&gt;
&lt;br /&gt;
[Response Body]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The web application informs web client of the allowed domain using the HTTP response header '''Access-Control-Allow-Origin'''.&lt;br /&gt;
The header can contains a '*' to indicate that all domain are allowed OR a specified domain to indicate the specified allowed domain.&lt;br /&gt;
&lt;br /&gt;
* '''Step 3 : Web client process web application response.'''&lt;br /&gt;
&lt;br /&gt;
According to the CORS W3C specification, it's up to the web client (usually a browser) to determine, using the web application response HTTP header '''Access-Control-Allow-Origin''', &lt;br /&gt;
if the web client is allowed to access response data.&lt;br /&gt;
&lt;br /&gt;
== Risk ==&lt;br /&gt;
&lt;br /&gt;
''A reminder : Into this article we focus on web application side because it's the only part in which we have the maximum of control.''&lt;br /&gt;
&lt;br /&gt;
The risk here is that a web client can put any value into the '''Origin''' request HTTP header in order to force web application to provide it the target resource content. &lt;br /&gt;
In the case of a Browser web client, the header value is managed by the browser but another &amp;quot;web client&amp;quot; can be used (like Curl/Wget/Burp suite/...) to change/override the &amp;quot;Origin&amp;quot; header value...&lt;br /&gt;
&lt;br /&gt;
== Countermeasure ==&lt;br /&gt;
&lt;br /&gt;
'''Option A: Use CORS authenticated request'''&lt;br /&gt;
&lt;br /&gt;
In this option, we enable authentication on the resources accessed and require that the user/application credentials be passed with the [https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Requests_with_credentials CORS requests].&lt;br /&gt;
&lt;br /&gt;
If the CORS resources exposed are classified as sensitive (and CORS exposition is mandatory) it's a good option but if the objective is only to ensure that the request originator is really &lt;br /&gt;
one of the allowed (to avoid rogue call), there somes drawback with this option, among others:&lt;br /&gt;
* The target application must manage users (or applications) credentials repositories including features like password expiry, password reset, brute force prevention, account lock/unlock,...&lt;br /&gt;
* The client application must store (in a secure way) the credentials to use,&lt;br /&gt;
* The client application must manage/configure credentials transfer in HTTP request in order that credentials are send only in case of CORS requests to target application.&lt;br /&gt;
&lt;br /&gt;
'''Option B: We can scrutiny the Origin header value on server side''' &lt;br /&gt;
&lt;br /&gt;
In this option, the objective is to work between steps 1 and 2 of the CORS HTTP requests/responses exchange process (see above).&lt;br /&gt;
&lt;br /&gt;
To achieve it, we will use JEE Web Filter that will ensure the following points for each incoming HTTP CORS requests:&lt;br /&gt;
# Have only one non empty instance of the '''origin''' header,&lt;br /&gt;
# Have only one non empty instance of the '''host''' header,&lt;br /&gt;
# The value of the origin header is present in an internal allowed domains list (white list). This check is done before step 2 of the CORS HTTP requests/responses exchange process, and the allowed domains list will be provided to the client,&lt;br /&gt;
# Cache IP of the sender for 1 hour. If the sender sends any requests with an origin domain that is not in the white list then all requests will return an HTTP 403 response (protract allowed domain guessing).&lt;br /&gt;
&lt;br /&gt;
We use the method above because it's not possible to be 100% certain that any request comes from an expected client application, since:&lt;br /&gt;
* All information of a HTTP request can be faked,&lt;br /&gt;
* It's the browser (or others tools) that send the HTTP request then the IP address that we have access to is the client IP address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#88421D&amp;quot;&amp;gt;In a Enterprise inter application communication it's possible to add a check on the client IP range. &lt;br /&gt;
&amp;quot;Business to business&amp;quot; communication offer possibility to for each part to indicate to others parts the IP range that it will &lt;br /&gt;
be used by its applications.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sample implementation: Filter class'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
import java.util.Enumeration;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.Filter;&lt;br /&gt;
import javax.servlet.FilterChain;&lt;br /&gt;
import javax.servlet.FilterConfig;&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.ServletRequest;&lt;br /&gt;
import javax.servlet.ServletResponse;&lt;br /&gt;
import javax.servlet.annotation.WebFilter;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
&lt;br /&gt;
import net.sf.ehcache.Cache;&lt;br /&gt;
import net.sf.ehcache.CacheManager;&lt;br /&gt;
import net.sf.ehcache.Element;&lt;br /&gt;
import net.sf.ehcache.config.CacheConfiguration;&lt;br /&gt;
import net.sf.ehcache.config.PersistenceConfiguration;&lt;br /&gt;
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Sample filter implementation to scrutiny CORS &amp;quot;Origin&amp;quot; HTTP header.&amp;lt;br/&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This implementation has a dependency on EHCache API because&amp;lt;br/&amp;gt;&lt;br /&gt;
 * it use Caching for blacklisted client IP in order to enhance performance.&lt;br /&gt;
 * &lt;br /&gt;
 * Assume here that all CORS resources are grouped in context path &amp;quot;/cors/&amp;quot;.&lt;br /&gt;
 * &lt;br /&gt;
 */&lt;br /&gt;
@WebFilter(&amp;quot;/cors/*&amp;quot;)&lt;br /&gt;
public class CORSOriginHeaderScrutiny implements Filter {&lt;br /&gt;
&lt;br /&gt;
	/** Filter configuration */&lt;br /&gt;
	@SuppressWarnings(&amp;quot;unused&amp;quot;)&lt;br /&gt;
	private FilterConfig filterConfig = null;&lt;br /&gt;
&lt;br /&gt;
	/** Cache used to cache blacklisted Clients (request sender) IP address */&lt;br /&gt;
	private Cache blackListedClientIPCache = null;&lt;br /&gt;
&lt;br /&gt;
	/** Domains allowed to access to resources (white list) */&lt;br /&gt;
	private List&amp;lt;String&amp;gt; allowedDomains = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#init(FilterConfig)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void init(FilterConfig fConfig) throws ServletException {&lt;br /&gt;
		// Get filter configuration&lt;br /&gt;
		this.filterConfig = fConfig;&lt;br /&gt;
		// Initialize Client IP address dedicated cache with a cache of 60 minutes expiration delay for each item&lt;br /&gt;
		PersistenceConfiguration cachePersistence = new PersistenceConfiguration();&lt;br /&gt;
		cachePersistence.strategy(PersistenceConfiguration.Strategy.NONE);&lt;br /&gt;
		CacheConfiguration cacheConfig = new CacheConfiguration().memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.FIFO)&lt;br /&gt;
		.eternal(false)&lt;br /&gt;
		.timeToLiveSeconds(3600)&lt;br /&gt;
		.diskExpiryThreadIntervalSeconds(450)&lt;br /&gt;
		.persistence(cachePersistence)&lt;br /&gt;
		.maxEntriesLocalHeap(10000)&lt;br /&gt;
		.logging(false);&lt;br /&gt;
		cacheConfig.setName(&amp;quot;BlackListedClientsCacheConfig&amp;quot;);&lt;br /&gt;
		this.blackListedClientIPCache = new Cache(cacheConfig);&lt;br /&gt;
		this.blackListedClientIPCache.setName(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
		CacheManager.getInstance().addCache(this.blackListedClientIPCache);&lt;br /&gt;
		// Load domains allowed white list (hard coded here only for example)&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;http://www.html5rocks.com&amp;quot;);&lt;br /&gt;
		this.allowedDomains.add(&amp;quot;https://www.mydomains.com&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#destroy()&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void destroy() {&lt;br /&gt;
		// Remove Cache&lt;br /&gt;
		CacheManager.getInstance().removeCache(&amp;quot;BlackListedClientsCache&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)&lt;br /&gt;
	 */&lt;br /&gt;
	@Override&lt;br /&gt;
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) &lt;br /&gt;
        throws IOException, ServletException {&lt;br /&gt;
		HttpServletRequest httpRequest = ((HttpServletRequest) request);&lt;br /&gt;
		HttpServletResponse httpResponse = ((HttpServletResponse) response);&lt;br /&gt;
		List&amp;lt;String&amp;gt; headers = null;&lt;br /&gt;
		boolean isValid = false;&lt;br /&gt;
		String origin = null;&lt;br /&gt;
		String clientIP = httpRequest.getRemoteAddr();&lt;br /&gt;
&lt;br /&gt;
		/* Step 0 : Check presence of client IP in black list */&lt;br /&gt;
		if (this.blackListedClientIPCache.isKeyInCache(clientIP)) {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 1 : Check that we have only one and non empty instance of the &amp;quot;Origin&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Origin&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Origin&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		origin = headers.get(0);&lt;br /&gt;
&lt;br /&gt;
		/* Step 2 : Check that we have only one and non empty instance of the &amp;quot;Host&amp;quot; header */&lt;br /&gt;
		headers = CORSOriginHeaderScrutiny.enumAsList(httpRequest.getHeaders(&amp;quot;Host&amp;quot;));&lt;br /&gt;
		if ((headers == null) || (headers.size() != 1)) {&lt;br /&gt;
			// If we reach this point it means that we have multiple instance of the &amp;quot;Host&amp;quot; header&lt;br /&gt;
			// Add client IP address to black listed client&lt;br /&gt;
			addClientToBlacklist(clientIP);&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
			// Add trace here&lt;br /&gt;
			// ....&lt;br /&gt;
			// Quick Exit&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 3 : Perform analysis - Origin header is required */&lt;br /&gt;
		if ((origin != null) &amp;amp;&amp;amp; !&amp;quot;&amp;quot;.equals(origin.trim())) {&lt;br /&gt;
			if (this.allowedDomains.contains(origin)) {&lt;br /&gt;
				// Check if origin is in allowed domain&lt;br /&gt;
				isValid = true;&lt;br /&gt;
			} else {&lt;br /&gt;
				// Add client IP address to black listed client&lt;br /&gt;
				addClientToBlacklist(clientIP);&lt;br /&gt;
				isValid = false;&lt;br /&gt;
				// Add trace here&lt;br /&gt;
				// ....&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		/* Step 4 : Finalize request next step */&lt;br /&gt;
		if (isValid) {&lt;br /&gt;
			// Analysis OK then pass the request along the filter chain&lt;br /&gt;
			chain.doFilter(request, response);&lt;br /&gt;
		} else {&lt;br /&gt;
			// Return HTTP Error without any information about cause of the request reject !&lt;br /&gt;
			httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Blacklist client&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param clientIP Client IP address&lt;br /&gt;
	 */&lt;br /&gt;
	private void addClientToBlacklist(String clientIP) {&lt;br /&gt;
		// Add client IP address to black listed client&lt;br /&gt;
		Element cacheElement = new Element(clientIP, clientIP);&lt;br /&gt;
		this.blackListedClientIPCache.put(cacheElement);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Convert a enumeration to a list&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param tmpEnum Enumeration to convert&lt;br /&gt;
	 * @return list of string or null is input enumeration is null&lt;br /&gt;
	 */&lt;br /&gt;
	private static List&amp;lt;String&amp;gt; enumAsList(Enumeration&amp;lt;String&amp;gt; tmpEnum) {&lt;br /&gt;
		if (tmpEnum != null) {&lt;br /&gt;
			return Collections.list(tmpEnum);&lt;br /&gt;
		}&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
[[Automated Audit using W3AF|W3AF]] audit tools (http://w3af.org) contains plugins to automatically audit web &lt;br /&gt;
application to check if they implements this type of countermeasure. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:#088A08&amp;quot;&amp;gt;&lt;br /&gt;
It's very useful to include this type of tools into a web application development process in order to &lt;br /&gt;
perform a regular automatic first level check (do not replace an manual audit and manual audit must be also conducted regularly).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Informations links ==&lt;br /&gt;
&lt;br /&gt;
* W3C Specification : http://www.w3.org/TR/cors/&lt;br /&gt;
* Mozilla Wiki : https://developer.mozilla.org/en-US/docs/HTTP_access_control&lt;br /&gt;
* Wikipedia : http://en.wikipedia.org/wiki/Cross-origin_resource_sharing&lt;br /&gt;
* CORS Abuse : http://blog.secureideas.com/2013/02/grab-cors-light.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Attack]]&lt;br /&gt;
[[Category:Injection Attack]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:SameSite&amp;diff=240378</id>
		<title>Talk:SameSite</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:SameSite&amp;diff=240378"/>
				<updated>2018-05-02T21:47:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: asking about expired rfc6265bis which is the only doc to define SameSite&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I know browsers have implemented the SameSite attribute, but the only IETF document that defines it is draft-ietf-httpbis-rfc6265bis-02, which is expired. RFC6265 does not include the SameSite attribute. Do browsers choose to implement draft specs on their own?&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=240255</id>
		<title>User:Jweiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=240255"/>
				<updated>2018-04-26T15:47:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added my coining MarTechSec and MarSecOps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started programming in Fortran in 1970. I wrote a COBOL program as an undergraduate. I actually wrote a program in APL at UMASS Amherst in 1978 as a graduate student. I put a 'Hello World' website from my portable computer at work on the internet without a firewall in 1996, just for a few hours, and just an IP address, no DNS name. &lt;br /&gt;
In 2005 I started the Boston OWASP chapter, and am still running it. &lt;br /&gt;
I got involved in application security at Staples from 2001 to 2007. I was the application security architect for Starwood Hotels from 2007 to 2017. Starwood was acquired by Marriott in 2017 and I'm currently an application security guy for Marriott. I've been focusing on client side application code and I coined the terms 'MarTechSec' and 'MarSecOps' on April 19 in my 3rd party JavaScript Management Cheatsheet page.&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=240253</id>
		<title>User:Jweiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=240253"/>
				<updated>2018-04-26T15:44:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added more work history - Staples, MI.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started programming in Fortran in 1970. I wrote a COBOL program as an undergraduate. I actually wrote a program in APL at UMASS Amherst in 1978 as a graduate student. I put a 'Hello World' website from my portable computer at work on the internet without a firewall in 1996, just for a few hours, and just an IP address, no DNS name. &lt;br /&gt;
In 2005 I started the Boston OWASP chapter, and am still running it. &lt;br /&gt;
I got involved in application security at Staples from 2001 to 2007. I was the application security architect for Starwood Hotels from 2007 to 2017. Starwood was acquired by Marriott in 2017 and I'm currently an application security guy for Marriott.&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240039</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240039"/>
				<updated>2018-04-18T19:15:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* MarSecOps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete and preventive controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. A data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240038</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240038"/>
				<updated>2018-04-18T19:14:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarTechSec =&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MarSecOps =&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. a data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing wants or without a significant number of dedicated resources, can make data layer and Subresource Integrity controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240037</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240037"/>
				<updated>2018-04-18T19:07:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarTechSec ==&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarSecOps ==&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. a data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. Virtual frame Containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing desires or without a significant number of dedicated resources, can make some controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240036</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240036"/>
				<updated>2018-04-18T19:07:07Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarTechSec ==&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarSecOps ==&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. a data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. virtual iframe containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing desires or without a significant number of dedicated resources, can make some controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240035</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240035"/>
				<updated>2018-04-18T19:04:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added sections on Virtual iframe Containment, MarTechSec, MarSecOps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual iframe Containment ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This technique creates iFrames that run asynchronously in relation to the main page. It also provides its own containment javascript that automates the dynamic implementation of the protected iFrames based on the marketing tag requirements.&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarTechSec ==&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarSecOps ==&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. a data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. virtual iframes containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing desires or without a significant number of dedicated resources, can make some controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240034</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240034"/>
				<updated>2018-04-18T19:01:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* MarTechSec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarTechSec ==&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarSecOps ==&lt;br /&gt;
Marketing Security Operations &lt;br /&gt;
&lt;br /&gt;
This refers to the operational requirements to maintain some of the technical controls. This involves possible cooperation and information exchange between the marketing team, the martech provider and the run or operations team to update the information in the page controls (SRI hash change, changes in pages with SRI), the policies in the Virtual iFrames, tag manager configuration, data layer changes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most complete controls for any site containing non-trivial marketing tags are -&lt;br /&gt;
&lt;br /&gt;
1. a data layer that calls the marketing server or tag manager APIs , so that only your code executes on your page (inversion of control)&lt;br /&gt;
&lt;br /&gt;
2. virtual iframes containment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MarSecOps requirements to implement technical controls at the speed of change that marketing desires or without a significant number of dedicated resources, can make some controls impractical.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240031</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=240031"/>
				<updated>2018-04-18T14:32:17Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added MarTechSec section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MarTechSec ==&lt;br /&gt;
&lt;br /&gt;
Marketing Technology Security&lt;br /&gt;
&lt;br /&gt;
This refers to all aspects of reducing the risk from marketing javascript. Controls include&lt;br /&gt;
&lt;br /&gt;
1. Contractual controls for risk reduction; the contracts with any MarTech company should include a requirement to show evidence of code security and code integrity monitoring.&lt;br /&gt;
&lt;br /&gt;
2. Contractual controls for risk transference: the contracts with any MarTech company could include a penalty for serving malicious javascript&lt;br /&gt;
&lt;br /&gt;
3. Technical controls for malicious javascript execution prevention; Virtual Iframes, &lt;br /&gt;
&lt;br /&gt;
4. Technical controls for malicious javascript identification; Subresource Integrity&lt;br /&gt;
&lt;br /&gt;
5. Technical controls including client side javascript malicious behavior in penetration testing requirements&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239980</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239980"/>
				<updated>2018-04-17T12:28:06Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: added to Vendor Agreements section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement or request for proposal with the 3rd parties require evidence that they have implemented secure coding and general corporate server access security. But in particular you need to determine the monitoring and control of their source code in order to prevent and detect malicious changes to that javascript.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239979</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239979"/>
				<updated>2018-04-17T12:23:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: spelling correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because sometimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239808</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239808"/>
				<updated>2018-04-12T17:58:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: changed 'the most' to 'a' for data layer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This is a secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239807</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=239807"/>
				<updated>2018-04-12T17:55:58Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: aded greatest risk line to Major Risks section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
The single greatest risk is a compromise of the third party javascript server, and the injection of malicious javascript into the original tag javascript. This has happened in 2018 and likely earlier.&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220874</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220874"/>
				<updated>2016-08-31T02:42:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Security Problems with requesting Tags */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
The previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. One way to manage this risk is with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220873</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220873"/>
				<updated>2016-08-31T02:39:22Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Subresource Integrity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitimes you can get '''secure''' but '''not working''' 3rd party code when the vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220872</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=220872"/>
				<updated>2016-08-31T02:14:19Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Tags, aka marketing tags, analytics tags etc. are small bits of javascript on a web page. They can also be HTML image elements when javascript is disabled. The reason for them is to collect data on the web user actions and browsing context for use by the web page owner in marketing.&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript tags (hereinafter, '''tags''') can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for '''tags'''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or '''tag manager''' site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a '''container''' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Tag Manager --&amp;gt;&lt;br /&gt;
       &amp;lt;script&amp;gt;(function(w, d, s, l, i){&lt;br /&gt;
         w[l] = w[l] || [];&lt;br /&gt;
         w[l].push({'tm.start':new Date().getTime(), event:'tm.js'});&lt;br /&gt;
         var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;amp;l=' + l : '';&lt;br /&gt;
         j.async=true;&lt;br /&gt;
         j.src='https://tagmanager.com/tm.js?id=' + i + dl;&lt;br /&gt;
         f.parentNode.insertBefore(j, f);&lt;br /&gt;
       })(window, document, 'script', 'dataLayer', 'TM-FOOBARID');&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /Tag Manager --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement:&lt;br /&gt;
&lt;br /&gt;
* technical controls such as only allowing the javascript to access the data layer values, no other DOM element&lt;br /&gt;
* restricting the tag types deployed on a host site, e.g. disabling of custom HTML tags and javascript code&lt;br /&gt;
&lt;br /&gt;
The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. It also can be two-factor authentication.&lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- 3rd party vendor javascript --&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;!-- /3rd party vendor javascript --&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Boston&amp;diff=217805</id>
		<title>Boston</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Boston&amp;diff=217805"/>
				<updated>2016-06-08T13:39:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Boston OWASP Chapter Leaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chapter Template|chaptername=Boston|extra=Follow @OWASPBOSTON on Twitter. The chapter leader is [mailto:jim.weiler@owasp.org Jim Weiler]. The Boston chapter is grateful for support from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Image:AuricLogo_160.png|link=http://www.auricsystems.com/|Auric Systems International]]&amp;lt;br/&amp;gt;--&amp;gt;|mailinglistsite=http://lists.owasp.org/mailman/listinfo/owasp-Boston|emailarchives=http://lists.owasp.org/pipermail/owasp-Boston}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Chapter Meetings --- Our Tenth Year ==&lt;br /&gt;
&lt;br /&gt;
We now use [http://www.meetup.com/owaspboston/ meetup] to organize meetings.&lt;br /&gt;
&lt;br /&gt;
We usually meet the FIRST WEDNESDAY of EVERY MONTH (Unless a speaker can only present another night), 6:30 to 9 pm. &lt;br /&gt;
&lt;br /&gt;
Everyone is welcome to come to any meeting, there is no signup or joining criteria, just come if it sounds interesting. Feel free to sign up to the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. This list is very low volume (2 - 3 emails/month); it is used to remind people about each monthly meeting, inform about local application security events and special chapter offers. &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Information for meeting updates about this and other Boston area user groups can also be found at [http://bug.bostonusergroups.org/Lists/Groups%20Calendar/calendar.aspx BostonUserGroups]. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most meetings are held at [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center).&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Training ===&lt;br /&gt;
&lt;br /&gt;
 '''July 18th &amp;amp; 19th 2016''' - Waltham - [https://www.regonline.com/Register/Checkin.aspx?EventID=1844420 Register]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact [https://www.google.com/maps/place/Constant+Contact/@42.4185837,-71.2586063,15z/data=!4m5!3m4!1s0x0:0xbcaab68dd299cf76!8m2!3d42.4185837!4d-71.2586063 Map] location: 1601 Trapelo Rd, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
8AM to 5PM '''Practical Web Application Penetration Testing - PWAPT'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This course provides customized training on the latest open source tools and manual techniques for performing end-to-end web application penetration testing engagements. After a quick overview of the penetration testing methodology, the instructor will lead students through the process of testing and exploiting a target web application using the techniques and approaches developed from a career of real world application penetration testing experiences. Students will be introduced to the best open source tools currently available for the specific steps of the methodology, including Burp Suite Pro, and taught how to integrate these tools with manual testing techniques to maximize effectiveness. A major goal of this course is teaching students the glue that brings the tools and techniques together to successfully perform a web application penetration test from beginning to end, an oversight in most web application penetration testing courses.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The majority of the course will be spent performing an instructor led, hands-on web application penetration test against a target application built specifically for this class using a modern technology stack (Python Flask) and including real vulnerabilities as encountered in the wild. No old-school vanilla PHP stuff here folks. Students won’t be given overly simplistic steps to execute independently. Rather, at each stage of the test, the instructor will present the goals that each testing task is to accomplish and perform the penetration test in front of the class while students do it on their own machine. Primary emphasis of these instructor led exercises will be placed on how to integrate the tools with manual testing procedures to improve the overall work flow. This experience will help students gain the confidence and knowledge necessary to perform web application penetration tests as an application security professional.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;PWAPT is a PortSwigger preferred [https://portswigger.net/training Burp Suite Training] course. PWAPT students will learn basic and advanced usage techniques for Burp Suite Pro, as well as discover obscure functionality hidden within the vast capabilities of the tool. Students will also receive a 2 week trial license for Burp Suite Pro to use during the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;outline&amp;quot;&amp;gt;Outline&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 1:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Methodology&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Reconnaissance&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Mapping&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Automated Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Day 2:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Manual Discovery (cont.)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Exploitation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Web Services&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;technical-requirements&amp;quot;&amp;gt;Technical Requirements&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Laptop with at least two (2) USB ports.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Latest VMware Player, VMware Workstation, or VWware Fusion installed. Other virtualization software such as Parallels or VirtualBox will probably work if the attendee is familiar with its functionality. However, VMware Player should be prepared as a backup.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Ability to disable all security software on their laptop such as Antivirus and/or firewalls (Administrator).&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least twenty (20) GB of hard drive space.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;At least four (4) GB of RAM.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tim (lanmaster53) Tomes&lt;br /&gt;
&lt;br /&gt;
Christian, father, husband, veteran, code slinger, aspiring difference-maker and hacking enthusiast.&lt;br /&gt;
&lt;br /&gt;
=== Upcoming Meetings ===&lt;br /&gt;
&lt;br /&gt;
 '''June 8, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/230842887/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [https://www.google.com/maps/place/5+Wall+St,+Burlington,+MA+01803/@42.4877956,-71.1904085,17z/data=!3m1!4b1!4m5!3m4!1s0x89e3758106c4cb55:0xc155e97a6d34883e!8m2!3d42.4877956!4d-71.1882198?hl=en Demandware] at 5 Wall St., Burlington, MA&lt;br /&gt;
&lt;br /&gt;
6-6:30 '''News, announcements, job postings, etc. '''&lt;br /&gt;
&lt;br /&gt;
6:30-7 '''Introduction to SQL Injection - Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Computer Science Curricula’s Failure - What Should We Do Now?''' - '''Ming Chow &amp;amp; Roy Wattanasin'''&lt;br /&gt;
&lt;br /&gt;
We are still facing the same security vulnerabilities from over a decade ago. The problems are not going away anytime soon and a reason is because Computer Science curricula are still churning out students who are not even exposed to security. This talk will address the lack of emphasis on information security in Computer Science curricula, how CS curricula have an obligation, how to gradually fix the problem by integrating security into many Computer Science undergraduate and graduate classes, and success stories from students. This talk will also discuss what Tufts and Brandeis are currently working on to further address the security education problem by creating a joint cyber security and policy program that spans multiple departments. Additional points and feedback from the audience are encouraged to help with the issue. All are encourage to attend to submit your feedback to help!&lt;br /&gt;
&lt;br /&gt;
Presenters: &lt;br /&gt;
&lt;br /&gt;
Ming Chow - @0xmchow &lt;br /&gt;
&lt;br /&gt;
Ming Chow is a Senior Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He was a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World, DEF CON, Intel, SOURCE Conference, and BSides Boston. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2014 and 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin - @wr0 &lt;br /&gt;
&lt;br /&gt;
Roy Wattanasin is an adjunct faculty at Brandeis University in both the Health and Medical Informatics and Information Security graduate programs. He spends most of his time leading, teaching and developing information security programs, finding vulnerabilities, performing incident response and working on many projects. Roy has spoken at many conferences including RSA, ISSA International, Source Conference, Braintank, Cyber Security World, OWASP and the Security BSides conferences. He is also a healthcare information security professional. He was a mentor for a Proving Ground speaker at BSides Las Vegas in 2015. &lt;br /&gt;
&lt;br /&gt;
 '''May 4, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229788205/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Slightly different [http://www.akamai.com/html/about/locations.html Akamai] location: 90 Broadway, Cambridge, MA 02142 between Meadhall and the Mariott&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZAP''' - '''Dan Cornell'''&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons to use source code to assist in web application penetration testing such as making better use of penetration testers’ time, providing penetration testers with deeper insight into system behavior, and highlighting specific sections of so development teams can remediate vulnerabilities faster. Examples of these are provided using the open source ThreadFix plugin for the OWASP ZAP proxy and dynamic application security testing tool. These show opportunities attendees have to enhance their own penetration tests given access to source code.&lt;br /&gt;
&lt;br /&gt;
This presentation covers the “ABCs” of source code assisted web application penetration testing: covering issues of attack surface enumeration, backdoor identification, and configuration issue discovery. Having access to the source lets an attacker enumerate all of the URLs and parameters an application exposes – essentially its attack surface. Knowing these allows pen testers greater application coverage during testing. In addition, access to source code can help to identify potential backdoors that have been intentionally added to the system. Comparing the results of blind spidering to a full attack surface model can identify items of interest such as hidden admin consoles or secret backdoor parameters. Finally, the presentation examines how access to source code can help identify configuration settings that may have an adverse impact on the security of the deployed application.&lt;br /&gt;
&lt;br /&gt;
Dan Cornell is a globally recognized application security expert, Dan Cornell holds over 15 years of experience architecting, developing and securing web-based software systems. As the Chief Technology Officer and a Principal at Denim Group, Ltd., he leads the technology team to help Fortune 500 companies and government organizations integrate security throughout the development process. He is also the original creator of ThreadFix, Denim Group's industry leading application security program management platform. Cornell was Principal Investigator as Denim Group researched and developed the Hybrid Analysis Mapping (HAM) technology that lies at the heart of ThreadFix, through a Small Business Innovation Research (SBIR) contract with the Department of Homeland Security's Science and Technology Directorate.&lt;br /&gt;
&lt;br /&gt;
More information at: http://www.denimgroup.com/about_team_dan.html&lt;br /&gt;
&lt;br /&gt;
 '''April 6, 2016''' - Cambridge - [http://www.meetup.com/owaspboston/events/229223967/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway, Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:00 '''Runtime Application Self-Protection (RASP) Tools''' - '''Kunal Anand'''&lt;br /&gt;
&lt;br /&gt;
This talk will highlight the latest in AppSec and dive into a different kind of solution called Runtime Application Self-Protection (RASP). We'll also explore a new methodology called language theoretic security (LANGSEC) and explain how it can outperform existing approaches like pattern matching, regular expressions, etc. This talk will lay the foundation via informal and formal theory how lexers, tokenizers and parsers work. We’ll move onto constructing an open source toolchain to analyzing data and exploring interactive data visualizations. Along the way, we’ll cover performance tradeoffs and discuss the challenges of modern application security.&lt;br /&gt;
&lt;br /&gt;
Kunal Anand is the co-founder and CTO of Prevoty, a runtime application security platform. Prior to that, he was the Director of Technology at the BBC Worldwide, overseeing engineering and operations across the company’s global Digital Entertainment and Gaming initiatives. Kunal also has several years of experience leading security, data and engineering at Gravity, MySpace and NASA’s JetPropulsion Laboratory. His work has been featured in Wired Magazine and Fast Company. Kunal received a B.S. from Babson College.&lt;br /&gt;
&lt;br /&gt;
=== Past Meetings ===&lt;br /&gt;
&lt;br /&gt;
 '''March 16, 2016''' - Burlington - [http://www.meetup.com/owaspboston/events/229156529/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Demandware, Burlington.&lt;br /&gt;
&lt;br /&gt;
6:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
6:30 '''Software Security by the Numbers''' - '''Chris Eng'''&lt;br /&gt;
&lt;br /&gt;
Deep dive into data we’ve collected about the state of software security in 2016 &lt;br /&gt;
* Based on scans of 200,000+ applications over an 18-month period &lt;br /&gt;
* How different industries and programming languages compare to one another &lt;br /&gt;
* Vulnerability remediation habits and patterns &lt;br /&gt;
* Three characteristics of a successful AppSec program &lt;br /&gt;
&lt;br /&gt;
Chris Eng is vice president of research at Veracode. In this role, he leads the team responsible for integrating security expertise into all aspects of Veracode’s technology. Throughout his career, he has led projects breaking, building, and defending web applications and commercial software for some of the world’s largest companies. Chris is a frequent speaker at premier industry conferences, where he has presented on a diverse range of topics, including cryptographic attacks, agile security, mobile application security, and security metrics. He has been interviewed by Bloomberg, Fox Business, CBS, and other media outlets worldwide.&lt;br /&gt;
&lt;br /&gt;
 '''January 26, 2016''' - Waltham - [http://www.meetup.com/owaspboston/events/228202040/ Meetup]&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Waltham.  Trapelo Rd. exit from Rt. 128, toward Lincoln. The parking lot entrance is on the right, at the first traffic light. Drive around to the front of the office complex, facing the highway. Enter under the clock tower. Park in the front of the building and enter in the main building lobby, continue down the hallway and you will see the innovation center, enter in the large glass doors. &lt;br /&gt;
&lt;br /&gt;
7:00 '''News, OWASP tools, documents review'''&lt;br /&gt;
&lt;br /&gt;
7:20 '''What Security Testing Tools Miss'''&lt;br /&gt;
&lt;br /&gt;
Black Duck Software presents - Static analysis, dynamic analysis, and other testing tools are all essential weapons against adversaries.  But for the 80%+ of companies worldwide that use open source software in their application development these tools are ineffective in identifying and mitigating open source security risks . This presentation will cover:&lt;br /&gt;
&lt;br /&gt;
The value of static and dynamic tools, and where they best fit in the Secure Development Lifecycle          &lt;br /&gt;
&lt;br /&gt;
Why these tools are not useful in identifying known vulnerabilities in open source components          &lt;br /&gt;
&lt;br /&gt;
Controls development and security professionals can deploy to select, detect, manage and monitor open source for existing and newly disclosed vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Food will be provided by Constant Contact.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''November 2015''' - Cambridge - [http://www.meetup.com/owaspboston/events/226394218/ Meetup]&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 150 Broadway &lt;br /&gt;
Cambridge, MA 02142 (aka 8 Cambridge Center)&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
Attendee interaction is always mentioned as a high value at meetings and was great at the MetroWest meetings, so we're doing that at Akamai this month. Some discussion starters so far: SSL certificate impacts from CA/Browser alliance decisions and SHA1 weakness; mutual (client) SSL, javascript client and server side; what the heck is threat intelligence, dev ops and faster secure SDLC.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Metrowest&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 20, 7:00 pm&lt;br /&gt;
&lt;br /&gt;
Location: Constant Contact, Innovation Center, Reservoir Place, 1601 Trapelo Road, Waltham, MA 02451&lt;br /&gt;
&lt;br /&gt;
7:00 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:30 '''Access in Maliceland - Risk Based Access Control''' - '''Gunnar Peterson'''&lt;br /&gt;
&lt;br /&gt;
John Lambert observed attackers win because while defenders think in lists, attackers think in graphs. Access control systems divide the system a priori into secure and insecure states. But that’s only worth the paper its printed on. A  Attackers see the system as it is, for attackers, the access control scheme is the beginning of the game not the end. Determined attackers seek out access control models and then find holes that they can leverage. Access control systems that purport to protect the system are built on assumptions from which reality diverges. Application security needs a new approach to access control- adding feedback loops for risk based decisions,  fine-grained, dynamic access control. &lt;br /&gt;
&lt;br /&gt;
Security is a business with a very long list of issues and requirements. The spreadsheets are miles long. This makes it essential to find reusable solution patterns that can address multiple problems.This presentation looks at both medium term improvements and code examples to improve access control decisions and overall security today&lt;br /&gt;
&lt;br /&gt;
Gunnar Peterson ([https://twitter.com/oneraindrop @oneraindrop]) focuses on security architecture consulting and training. Experience includes Associate Editor for IEEE Security &amp;amp; Privacy Journal, a Microsoft MVP for App security, an IANS Research Faculty member, a Securosis Contributing Analyst, and a Visiting Scientist at Carnegie Mellon Software Engineering Institute. He maintains a popular information security blog at http://1raindrop.typepad.com.&lt;br /&gt;
&lt;br /&gt;
 '''July 2015''' - Cambridge&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 8, 6:30 pm  ''NOTE: It's the second Wednesday this month.''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Interactive Discussions (Come and ask your questions!)''' &lt;br /&gt;
&lt;br /&gt;
 '''June 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Put Down the Megaphone: Effective Security Advocacy Without the Shouting''' - '''Darren Meyer'''&lt;br /&gt;
&lt;br /&gt;
10 years’ experience in the InfoSec community--including work with organizations in many verticals, in sizes ranging from startups to Fortune 50 enterprises, leading Application Security teams, building and delivering security instruction to developers, managers, and InfoSec professionals—has taught me the importance of crafting advocacy for different audiences. In this talk, I share my experiences in learning to be an effective advocate with three key audiences: developers, management, and non-technical staff.&lt;br /&gt;
&lt;br /&gt;
Darren is an Application Security advocate and researcher, technology hobbyist, and maker. He loves to learn, teach, nerd out, and inflict terrible puns on people. His background includes logistics, software development, and an assortment of information security roles including leading AppSec programs and professional security instruction targeting developers, managers, and InfoSec professionals.&lt;br /&gt;
&lt;br /&gt;
 '''May 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How the crowd is discovering critical vulns missed by traditional methods''' - '''Leif Dreizler'''&lt;br /&gt;
&lt;br /&gt;
State of the art security programs are turning to bug bounties to leverage a vast array of skill-sets and knowledge. Learn why these programs work, when to deploy them, and how you can bring these new application security testing capabilities into your own organization. The speaker will discuss real world examples from bug bounties and focus on cases where business logic flaws and high priority vulnerabilities were found ... even with existing security testing processes in place. &lt;br /&gt;
&lt;br /&gt;
Attendees will learn:&lt;br /&gt;
&lt;br /&gt;
Testing methods deployed by our crowd that help them find bugs the scanners miss&lt;br /&gt;
&lt;br /&gt;
Examples of the high quality of bugs our crowd is finding, including P1'sTrends which vulnerability types are found most often and whyWhat is the ROI on the pay for performance modelWhere does the SDLC merge into crowdsourced testing&lt;br /&gt;
&lt;br /&gt;
Leif Dreizler is a Senior Security Engineer at Bugcrowd, the innovator in crowdsourced security testing for the enterprise. Prior to joining Bugcrowd, Leif was a Senior Application Security Engineer at Redspin, performing application security assessments. During his time at Redspin he also served as the Application Team Lead, liaising with clients at the engineering and sales level. He has also made minor contributions to the Firebug project. Leif attended the University of California, Santa Barbara where he studied Computer Science. Leif recently spoke to the NYC Security Meet-up group.&lt;br /&gt;
&lt;br /&gt;
 '''April 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler Will show some actual examples and patterns of SQL Injection attempts&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Are You An Imposter? Me too!''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
Many people in the information security field feel like a fraud, or an imposter. In reality, we often know far more, and are capable of far more than we believe we do. There is so much to know and we constantly hear about the latest groundbreaking research done by others, which makes us feel less important or worthy. Let’s talk about what Imposter Syndrome is, its prevalence, and then we can start to realize just how capable we are and go forward with the confidence in the field.&lt;br /&gt;
&lt;br /&gt;
 '''March 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, March 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News, views, announcements, conversation'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Prioritizing Web Application Vulnerabilities – A Hacker’s Perspective''' - '''Nick Silver'''&lt;br /&gt;
&lt;br /&gt;
The best application risk models capture not only the technical risk factors, but also the business context in which an asset lives.  Traditionally, this is done by auditing application owners on an array of questions in order to properly classify the asset and its data – but that takes time which could be better spent elsewhere.  We interviewed dozens of hackers and asked them which vulnerabilities they would look for first depending on the type of attack they wanted to carry out.  We’ll walk through several examples of how to use this data as a shortcut means for prioritizing risk without the need for any pesky audit questionnaires.&lt;br /&gt;
&lt;br /&gt;
Nick Silver is a Senior Solutions Architect with WhiteHat Security.  He is responsible for translating business requirements into technical ones and assisting businesses in implementing web security programs.  Previously, Nick led a team in WhiteHat’s Threat Research Center where they were responsible for testing more than 2,000 of their customers’ websites for vulnerabilities.  &lt;br /&gt;
&lt;br /&gt;
 '''February 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, announcements''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''Incident Response and Web Application Security - Stories from the Trenches''' - '''Fred House and Joe Ceirante'''&lt;br /&gt;
&lt;br /&gt;
Mandiant has conducted numerous incident response engagements throughout its history, including a record number of 200 incidents in 2014. Mandiant consultants Fred House and Joe Ceirante will discuss case studies and trends Mandiant has observed in relation to web application security.&lt;br /&gt;
 &lt;br /&gt;
Topics will include the types of threat actors that target web applications, the techniques they use to compromise web applications, and the activities they perform once inside the network. Techniques for detecting and mitigating web compromises will also be reviewed. All content will be derived from the real-world compromises that Mandiant has investigated.&lt;br /&gt;
&lt;br /&gt;
 '''January 2015'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 7, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News review, risk analysis of Poodle''' - '''Jim Weiler'''&lt;br /&gt;
 &lt;br /&gt;
7:00 '''How a Hacker Views Your Web Site''' - '''Patrick Laverty'''&lt;br /&gt;
&lt;br /&gt;
''The most popular presentation of BASC 2014''&lt;br /&gt;
&lt;br /&gt;
As defenders, we have to be right 100% of the time where an attacker only needs to be right once. The attack surface of a modern web site is incredibly large and we need to be aware of all of it. Additionally, individual attacks may not always be effective but sometimes using them together can gain the desired effect. In this talk, we’ll take a look at the whole attack surface for a typical web site and the various ways that an attacker will use to compromise a site.&lt;br /&gt;
&lt;br /&gt;
 '''December 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, December 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 '''News and Views You Can Use and Abuse''' - '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
* Some thoughts and analysis on some current app security news and other stuff&lt;br /&gt;
* Adobe password breach&lt;br /&gt;
* Reducing Web Application Firewall SQL injection false positives&lt;br /&gt;
 &lt;br /&gt;
7:15 '''Swift and Security''' - '''Ming Chow'''&lt;br /&gt;
 &lt;br /&gt;
Apple is pushing its new programming language Swift for iOS development and for many good reasons.  This talk will discuss what the language has right in terms of security, the old and new security pitfalls, and what developers need to be aware of moving forward with using the new language.  The fact to the matter is, iOS isn't going away, iOS developers will need to learn and use Swift, and there will be a big rush of Swift-based apps: we might as well learn how to do it right the first time around.&lt;br /&gt;
 &lt;br /&gt;
Ming Chow is an Instructor at the Department of Computer Science, Tufts University. Ten years of web development experience.&lt;br /&gt;
Specialties: Web and Mobile Development, Web and Mobile Security&lt;br /&gt;
&lt;br /&gt;
 '''July 2014'''&lt;br /&gt;
&lt;br /&gt;
Topics: '''Grails Security''' and '''Validating Cross-Site Scripting Vulns with xssValidator'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Cyrus Malekpour''' and '''John Poulin'''&lt;br /&gt;
&lt;br /&gt;
When: Tuesday, July 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic 1: ''Grails Security''&lt;br /&gt;
&lt;br /&gt;
Grails is a framework developed for Groovy in the vein of Rails for Ruby. It provides a lot of features for web app security, but does it do enough? What might you need to implement yourself, and what might be provided? This presentation will discuss tips on securing Grails applications, including tools that the framework provides by default for security. It'll also discuss several shortcomings in the current toolset, and how you can avoid them.&lt;br /&gt;
 &lt;br /&gt;
Cyrus Malekpour (@cmalekpour) is currently interning at nVisium, working on web app development and security. He's currently an undergraduate student at the University of Virginia, where he's studying computer science with an emphasis on security and backend development. &lt;br /&gt;
 &lt;br /&gt;
Topic 2: ''Validating Cross-Site Scripting Vulns with xssValidator''&lt;br /&gt;
 &lt;br /&gt;
xssValidator is a tool developed to automate the testing and validation of Cross-Site Scripting (xss) vulnerabilities within web applications. Automated scanners tend to report large amounts of false-positives, and as consultants we're forced spending our time trying to verify these findings. xssValidator leverages scriptable web-browsers such as PhantomJS and Slimer.js to automatically validate these findings.&lt;br /&gt;
 &lt;br /&gt;
John Poulin is an application security consultant for nVisium who specializes in web application security. He worked previously as a web developer and software engineer that focused on building multi-tier web applications. When he's not hacking on web apps, John spends his time building tools to help him hack on web apps! You can find him on twitter: @forced_request and on myspace: REDACTED.&lt;br /&gt;
&lt;br /&gt;
 '''June 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection and the OWASP Zed Attack Proxy (ZAP)'''&lt;br /&gt;
&lt;br /&gt;
Presenters: '''Rob Cheyne and Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 4, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
6:30 - general networking, news discussion, announcements.&lt;br /&gt;
&lt;br /&gt;
7:00 - main presentations&lt;br /&gt;
&lt;br /&gt;
The June 4th meeting will be the second in our series of 2014 training meetings. Rob Cheyne will continue explaining and exploring SQL Injection by conducting an actual injection attack.&lt;br /&gt;
&lt;br /&gt;
This will be a demo-based discussion to get into the mindset of an attacker, and show how an attacker goes after a site. Demo will include: &lt;br /&gt;
&lt;br /&gt;
* BurpProxy demo &lt;br /&gt;
* Common authentication flaws &lt;br /&gt;
* SQL Injection Demo that shows the process and how it builds to a full compromise&lt;br /&gt;
&lt;br /&gt;
'''Rob Cheyne''' is currently CEO of Big Brain Security. In addition to security consulting for Fortune 500 customers, he was the author of LC4, a version of the award-winning L0phtCrack password auditing tool, and he also worked on the code scanning technology that was eventually spun off as Veracode. Rob was at @stake from the very first customer all the way through to the $50M acquisition by Symantec.&lt;br /&gt;
&lt;br /&gt;
'''Jim Weiler''' will introduce the OWASP Zed Attack Proxy (ZAP). This is a very powerful free OWASP intercepting proxy that lets you see, analyze, change, replay etc. every browser request and response, analyze your session, scan and attack web sites, save the results and run reports. We can't cover all the functionality but we'll show some practical tips and techniques.&lt;br /&gt;
&lt;br /&gt;
Pizza, salad and soda courtesy of Akamai&lt;br /&gt;
&lt;br /&gt;
 '''March 2014'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Training: SQL Injection, WebGoat, Cross Site Request Forgery'''&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
When: Wednesday, March 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
There will be three training sessions:&lt;br /&gt;
&lt;br /&gt;
One will be on SQL Injection - intro, detection, prevention, scanning and false positives. This is the most serious web application vulnerability.&lt;br /&gt;
&lt;br /&gt;
The second will be on OWASP WebGoat. WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons. You can install and practice with WebGoat in either J2EE or in ASP.NET. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat applications. There are hints and 39 different lesson plans on various vulnerabilities and technologies. We won't cover all of them of course!&lt;br /&gt;
&lt;br /&gt;
The third will be on Cross Site Request Forgery - not a hack really, it's just the way the web works. But it causes apps to do legitimate things that you didn't ask them to do.&lt;br /&gt;
&lt;br /&gt;
Pizza and drinks provided by Akamai.&lt;br /&gt;
&lt;br /&gt;
 '''January 2014'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, January 8, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''JavaScript Verification: From Browsers to Pages'''&lt;br /&gt;
&lt;br /&gt;
Modern web browsers implement a &amp;quot;private browsing&amp;quot; mode that is intended to leave behind no traces of a user's browsing activity on their computer. This feature is in direct tension with support for *extensions*, which let users add third-party functionality into their browser. I will discuss the scope of this problem, present our approach to verifying extensions' compliance with private browsing mode, and sketch our findings on several real, third-party extensions. I will then briefly describe the toolkit underlying our approach, and end with a sketch of a newer project, adapting this approach to the very different-seeming problem of statically catching errors when using the jQuery library.&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Benjamin Lerner'''&lt;br /&gt;
&lt;br /&gt;
Benjamin Lerner has just completed a post-doctoral research position in the PLT group at Brown University, and is now a lecturer at Northeastern University.  His research examines the challenges of analyzing client-side web programming, from the behavior of web pages down through the semantics of the browser.  He received a PhD in Computer Science from the University of Washington in 2011, building a platform to analyze conflicts between browser extensions, and a B.S. in Computer Science and Mathematics from Yale University.&lt;br /&gt;
&lt;br /&gt;
 '''November 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, November 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Attacking iOS Applications'''  &lt;br /&gt;
&lt;br /&gt;
Slides: [http://www.slideshare.net/kfosaaen/i-os-gcandpb On slideshare]&lt;br /&gt;
&lt;br /&gt;
This presentation will cover the basics of attacking iOS applications (and their back ends) using a web proxy to intercept, modify, and repeat HTTP/HTTPS requests. (The proxy used during research was Burp; however, any HTTP intercepting proxy such as OWASP ZAP could be used) From setting up the proxy to pulling data from the backend systems, this talk will be a great primer for anyone interested in testing iOS applications at the HTTP protocol level. There will be a short (2 minute) primer on setting up the intercepting proxy, followed by three practical examples showing how to intercept data headed to the phone, how to modify data heading to the application server, and how to pull extra data from application servers to further an attack. All of these examples will focus on native iOS apps (Game Center and Passbook) and/or functionality (Passbook Passes).&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Karl Fosaaen'''&lt;br /&gt;
&lt;br /&gt;
Karl is a senior security consultant at NetSPI. This role has allowed Karl to work in a variety of industries, including financial services, health care, and hardware manufacturing. Karl specializes in network and web application penetration testing. In his spare time, Karl helps out as an OPER at THOTCON and a swag goon at DEF CON.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''October 2013'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, October 2, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Topic: '''Abusing NoSQL Databases'''&lt;br /&gt;
&lt;br /&gt;
The days of selecting from a few SQL database options for an application are over. There is now a plethora of NoSQL database options to choose from: some are better than others for certain jobs. There are good reasons why developers are choosing them over traditional SQL databases including performance, scalabiltiy, and ease-of-use. Unfortunately like for many hot techologies, security is largely an afterthought in NoSQL databases. This short but concise presentation will illustrate how poor the quality of security in many NoSQL database systems is. This presentation will not be confined to one particular NoSQL database system. Two sets of security issues will be discussed: those that affect all NoSQL database systems such as defaults, authentication, encryption; and those that affect specific NoSQL database systems such as MongoDB and CouchDB. The ideas that we now have a complicated heterogeneous problem and that defense-in-depth is even more necessary will be stressed. There is a common misconception that SQL injection attacks are eliminated by using a NoSQL database system. While specifically SQL injection is largely eliminated, injection attack vectors have increased thanks to JavaScript and the flexibility of NoSQL databases. This presentation will present and demo new classes of injection attacks. Attendees should be familiar with JavaScript and JSON. &lt;br /&gt;
&lt;br /&gt;
Presenter: '''Ming Chow'''&lt;br /&gt;
&lt;br /&gt;
Ming Chow (@tufts_cs_mchow) is a Lecturer at the Tufts University Department of Computer Science. His areas of work are in web and mobile engineering and web security. He teaches courses largely in the undergraduate curriculum including the second course in the major sequence, Web Programming, Music Apps on the iPad, and Introduction to Computer Security. He was also a web application developer for ten years at Harvard University. Ming has spoken at numerous organizations and conferences including the High Technology Crime Investigation Association - New England Chapter (HTCIA-NE), the Massachusetts Office of the Attorney General (AGO), John Hancock, OWASP, InfoSec World (2011 and 2012), DEF CON 19 (2011), the Design Automation Conference (2011), Intel, and the SOURCE Conference (Boston 2013). Ming's projects in information security include building numerous CTF challenges, Internet investigations, HTML5 and JavaScript security, and Android forensics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''September 2013 - Joint Meeting with [http://www.meetup.com/Boston-cloud-services/ Boston Cloud Services]''' &lt;br /&gt;
&lt;br /&gt;
When: Tuesday, September 10, 6 pm&lt;br /&gt;
&lt;br /&gt;
Location: Microsoft NERD Center ''(not our usual location)''&lt;br /&gt;
&lt;br /&gt;
'''Note: This is a joint meeting. Please register at [http://www.meetup.com/Boston-cloud-services/ the Boston Cloud Services meetup page] if you plan to attend.'''&lt;br /&gt;
&lt;br /&gt;
There will be two presentations at this meeting:&lt;br /&gt;
&lt;br /&gt;
Topic: '''People Centric Security (PCS)'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Nick Stamos'''&lt;br /&gt;
&lt;br /&gt;
People Centric Security (PCS) is a new security model, presented as part of Gartner's Maverick Research 2 year ago. PCS is well suited for Cloud Business/Consumer services such as Dropbox, Google Drive, SkyDrive, etc. PCS enables users to have what they desire, and provides enterprises what they require for data governance and compliance. Nick Stamos co-founded his fourth company, nCrypted Cloud in July of 2012. His past startups include Verdasys, Phase Forward (IPO FY2004, $685M Oracle Acquisition 2010), and Amulet. He studied at Tufts University where he received a BSEE and MSEE.&lt;br /&gt;
&lt;br /&gt;
Topic: '''SSL Certs'''&lt;br /&gt;
&lt;br /&gt;
Presenter: '''Jim Weiler'''&lt;br /&gt;
&lt;br /&gt;
Practical experiences with issuing and risk assessing SSL certs for enterprise applications on a cloud provider: who creates the CSR, how do you protect the private key on the cloud server, certs on cloud provider managed load balancers vrs 3rd party managed app servers, roles and responsibilities of cloud IT, 3rd party developer IT, enterprise IT and service providers. Jim Weiler is Application Security Architect at Starwoods Hotels and the Chapter Leader of OWASP Boston.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July 2013 - Doubleheader!'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, July 10, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Topic: '''RailsGoat'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Ken Johnson'''&lt;br /&gt;
&lt;br /&gt;
Abstract: While working to secure rails applications in a truly Agile development environment, it became clear that the Rails and Ruby ecosystem needed attention from the security community in the form of free and open training, and the events that have transpired within the last few months have only reinforced that belief. [http://railsgoat.cktricky.com/ RailsGoat] is an attempt to bring attention to both the problems that most frequently occur in Rails as well as the solutions for remediation. To accomplish this, we've built a vulnerable Rails application that aligns with the OWASP Top 10 and can be used as a training tool for Rails-based development shops.&lt;br /&gt;
&lt;br /&gt;
Topic: '''PhoneGap on Android'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Jack Mannino'''&lt;br /&gt;
&lt;br /&gt;
Abstract: PhoneGap is a widely used framework that allows developers to rapidly build cross-platform mobile applications using HTML5, JavaScript, and CSS. Using PhoneGap plugins, developers can call native platform APIs from browser-like applications using JavaScript. This approach introduces vulnerabilities that are not typically as prevalent within native Android applications, warranting a fresh look at the way we view mobile applications. In this presentation, we will take a deep look at the Android implementation of the framework and we will examine the overall attack surface for applications. Real-world examples of vulnerable applications will be demonstrated as well in order to provide context, entertainment, and enjoyment.&lt;br /&gt;
&lt;br /&gt;
About the Speakers:&lt;br /&gt;
&lt;br /&gt;
Ken Johnson is the former Manager of LivingSocial.com's application security team where he built their security program before leaving for his true home as the CTO of nVisium Security, a VA-based application security company. Ken is the primary developer of the Web Exploitation Framework and contributes to other open source application security projects as often as time permits. He has spoken at AppSec DC 2010 and 2012, OWASP NoVA and Phoenix chapters, Northern Virginia Hackers Association (NoVAH) and is a contributor to the Attack Research team.&lt;br /&gt;
&lt;br /&gt;
Jack Mannino is the CEO of nVisium Security, a VA-based application security company. At nVisium, he helps to ensure that large corporations, government agencies, and software startups have the tools they need to build and maintain successful security initiatives. He is an active Android security researcher/tinkerer, and has a keen interest in identifying security issues and trends on a large scale. Jack is a leader and founder of the OWASP Mobile Security Project. He is the lead developer for the OWASP GoatDroid project, and is the chairman of the OWASP Northern Virginia chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''June 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''We see the future…and it isn’t pretty'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Andrea Mulligan, Sr. Director at Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, June 5, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
In this session Andrea presents research findings from the State of Software Security Report, which offers a before the breach look at security by examining the flaws commonly found in applications of all kinds. She will also examine what the research findings mean for security, predict how these flaws could cause history to repeat itself, and discuss how security pros can help change the future. &lt;br /&gt;
&lt;br /&gt;
 '''May 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Systems Thinking + Web Security'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Akamai'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, May 1, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Akamai will present on ‘Systems Thinking + Web Security’. There will also be an audience review exercise facilitated by the Akamai presenters.  This is a great chance to hear some interesting perspectives on web security from Akamai, who handles about one third of all internet traffic.&lt;br /&gt;
&lt;br /&gt;
 '''April 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Go Fast. Be Secure: Effectively Govern the Use of Open Source Components Throughout the SDLC'''&lt;br /&gt;
&lt;br /&gt;
Presented by: '''Sonotype'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, April 3, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
* Open Source Software (OSS) Component supply chain complexities and realities. Open source is constantly changing and knowing the version in your software, as well as the current version history of the component (how do you show an auditor you are using a current version) is important. &lt;br /&gt;
* Open Source Consumption Patterns from the Central Repository. Which versions are the most popular can tell you which versions are the most stable, useful, secure etc.&lt;br /&gt;
* OWASP Top 10 (A9) - Using Components with Known Vulnerabilities. To decide on the risk of OSS components with vulnerabilities, you need to know the vulnerabilities, their severity and which components they occur in as well as where in the code dependency tree they are. &lt;br /&gt;
* OSS Security, Quality and License policies must be woven into the development process. Knowing the number and type of open source licenses in your software can be important to the legal standing of your code and if it conflicts with any corporate standards. The licensing is also important in order to know the restrictions on changing the software.&lt;br /&gt;
* OSS Component Policy Examples&lt;br /&gt;
* Example Application Compositions Reports&lt;br /&gt;
* Example Use cases IDE, CI, repository, production applications&lt;br /&gt;
* Discussion&lt;br /&gt;
&lt;br /&gt;
About Sonatype:&lt;br /&gt;
&lt;br /&gt;
Sonatype operates the Central Repository, the industry's primary source for open-source components, housing more than 400,000 components and serving more than five billion requests per year from more than 60,000 organizations. The company has been a pioneer in component-based software development since its founding by Jason van Zyl, the creator of the Apache Maven build management system and the Central Repository. &lt;br /&gt;
&lt;br /&gt;
 '''March 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''What is BSIMM?'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Nabil Hannan'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Nabil is Director of Vulnerability Assessments and Managing Consultant at Cigital.&lt;br /&gt;
 &lt;br /&gt;
The purpose of the BSIMM is to quantify the activities carried out by real software security initiatives. BSIMM is a study of the secure development practices of over 50 organizations, analyzed along the dimensions that were found in the data, not along preconceived ideas of what secure development should be.  &lt;br /&gt;
&lt;br /&gt;
BSIMM describes the work of 974 software security group members working with a satellite of 2039 people to secure the software developed by 218,286 developers. &lt;br /&gt;
&lt;br /&gt;
The BSIMM describes 111 activities that any organization can put into practice. The activities are described in twelve practices grouped into four domains. Associated with each activity is an objective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''February 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''BroBot'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Eric Kobrin, Akamai'''&lt;br /&gt;
&lt;br /&gt;
When: Wednesday, February 6, 6:30 pm&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Eric Kobrin is a Senior Security Architect in the Infosec organization of Akamai Technologies, the global leader in Cloud-based application acceleration and content delivery. Eric has been involved in Software Architecture for over 15 years, having worked at such companies and IBM, Velocitude and eDiets.com. He has a passion for programming languages, security, and software performance and has worked in all layers of the software stack from hypervisors to complex servers and web applications. Eric's works have been published, presented at international conferences and patented.&lt;br /&gt;
 &lt;br /&gt;
His presentation will provide an analysis of the BroBot DDOS attacks, including discussion of:&lt;br /&gt;
&lt;br /&gt;
* Vulnerable system discovery&lt;br /&gt;
* Zombie compromise&lt;br /&gt;
* Control structure&lt;br /&gt;
* Attack traffic&lt;br /&gt;
* Mitigation steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''January 2013'''&lt;br /&gt;
&lt;br /&gt;
Topic: '''Third-Party Application Analysis: Best Practices and Lessons Learned'''&lt;br /&gt;
&lt;br /&gt;
Speaker: '''Chad Holmes, Veracode'''&lt;br /&gt;
&lt;br /&gt;
Location: [http://www.akamai.com/html/about/locations.html Akamai] at 8 Cambridge Center in Cambridge, MA&lt;br /&gt;
&lt;br /&gt;
Chad Holmes will present details of the work Veracode has been doing with their 3rd Party program, discuss the technical and business challenges that have arisen during that time and lead a discussion on what team members can do to help drive adoption of security best practices across their vendor community.&lt;br /&gt;
&lt;br /&gt;
The flow of the presentation is designed to drive discussion within an audience – both from a technical and business perspective with some anecdotal stories. Chad wants this to be an interactive discussion so he’ll have questions and you should bring yours I’ve already sent him some.  The order of the presentation is:&lt;br /&gt;
&lt;br /&gt;
·         Adoption rates of externally developed software&lt;br /&gt;
&lt;br /&gt;
·         The risk within those apps&lt;br /&gt;
&lt;br /&gt;
·         Some deeper stats on what “3rd party” really means (total outsourcing/total COTS produced/open source/imported libraries/etc)&lt;br /&gt;
&lt;br /&gt;
·         Some raw data about our experiences (to show this is based on a large sample size rather than “Look how awesome Veracode is!”)&lt;br /&gt;
&lt;br /&gt;
·         Challenges that will be faced (business, intellectual property, policy, analysis capabilities, etc)&lt;br /&gt;
&lt;br /&gt;
·         Best Practices for high rates of adoption&lt;br /&gt;
&lt;br /&gt;
·         Lessons Learned and Recommendations&lt;br /&gt;
&lt;br /&gt;
Chad Holmes has over 10 years of software development and application security experience. During his time at Veracode, Chad has lead the redesign and execution of the third-party analysis process to allow for a more streamlined approach while still addressing common ISV intellectual property concerns. In addition to his third-party analysis responsibilities, Chad's previous work as a Security Program Manager has lead to the successful roll out and improvement of multiple corporate application security groups.&lt;br /&gt;
&lt;br /&gt;
 '''June 2012'''&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker '''Will Vandevanter - Rapid 7'''&lt;br /&gt;
&lt;br /&gt;
'''Fingerprinting web applications of all kinds'''&lt;br /&gt;
&lt;br /&gt;
This turbo talk will introduce a new Metasploit module that fingerprints &amp;quot;known&amp;quot; web applications, attempts the default credentials for the application, and runs an associated exploit or authenticated access module if applicable. Some example fingerprints in the database target common enterprise web applications including Microsoft products (Outlook Web Access, Sharepoint), printers (Xerox Document Centre), security cameras, routers, and others. &lt;br /&gt;
&lt;br /&gt;
Will Vandevanter is a senior penetration tester and researcher at Rapid7. His focus interests include web application security and secure code. He has previously spoken at Defcon, SOURCE, BSides LV, and other conferences. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 '''May 31 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Jobspring, Boston. 545 Boylston st. &lt;br /&gt;
&lt;br /&gt;
Speaker - '''Glenn Gramling, Vice President, Cenzic'''&lt;br /&gt;
&lt;br /&gt;
“Cloudy with a Chance of Hack”&lt;br /&gt;
&lt;br /&gt;
Cloud computing is a cost effective and efficient way for enterprises to automate their processes. However organizations need to be aware of the pitfalls of the many cloud solutions out there - one of the main being security. Most cloud applications were built for ease of use and without security necessarily in mind. Companies need to be asking their solution providers about the security measures used in developing the application and get an independent verification to make sure there are no gaping holes. With over 75% of attacks occurring through the Web, any attack through these applications can lead to leakage of confidential information and embarrassment. In this session, we'll give attendees tips and tricks to prepare them for the potential of &amp;quot;stormy weather.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Glenn Gramling is responsible for global sales and business development for Cenzic’s  application security.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''April 11, 2012'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
Speaker - '''David Eoff, Senior Product Marketing Manager, HP Enterprise Security'''&lt;br /&gt;
&lt;br /&gt;
David is a Senior Product Marketing Manager, within the Enterprise Security Products division of HP focused on Fortify application security. His 18+ years of background in software and hardware enterprise marketing provides a solid foundation for his marketing of the HP security solutions. &lt;br /&gt;
 &lt;br /&gt;
Prior to joining Fortify in 2009 and being acquired by HP, David ran Firewall and IPS marketing for the Security division of Nokia Corporation. In addition, he has held multiple positions in product marketing, product management, channel marketing and sales while working for Oracle, EMC, Legato, BMC Software and several start-ups.&lt;br /&gt;
&lt;br /&gt;
Topic - '''Gray, the New Black:  Gray-Box Vulnerability Testing'''&lt;br /&gt;
&lt;br /&gt;
Over the years, two key techniques have emerged as the most effective for finding security vulnerabilities in software:  Dynamic Application Security Testing (DAST) and Static Application Security Testing (SAST).  While DAST and SAST each possess unique strengths, the “Holy Grail” of security testing is thought to be “hybrid” – a technique that combines and correlates the results from both testing methods, maximizing the advantages of each. Until recently, however, a critical element has been missing from first generation hybrid solutions:  information about the inner workings and behavior of applications undergoing DAST and SAST analysis.&lt;br /&gt;
 &lt;br /&gt;
This presentation will introduce you to the next generation of hybrid security analysis – what it is, how it works, and the benefits it offers.  It will also address (and dispel) the claims against hybrid, and leave you with a clear understanding of how the new generation of hybrid will enable organizations to resolve their most critical software security issues faster and more cost-effectively than any other available analysis technology.&lt;br /&gt;
&lt;br /&gt;
 '''March 8, 2012, with the Boston Security Meetup group'''&lt;br /&gt;
&lt;br /&gt;
Location - [http://maps.google.com/maps?q=Jobspring+Partners,+Boylston+Street,+Boston,+MA&amp;amp;hl=en&amp;amp;sll=42.362243,-71.081628&amp;amp;sspn=0.019549,0.037594&amp;amp;oq=jobspring&amp;amp;t=v&amp;amp;hq=Jobspring+Partners,&amp;amp;hnear=Boylston+St,+Boston,+Massachusetts&amp;amp;z=17 JobSpring, Boylston St.]&lt;br /&gt;
&lt;br /&gt;
Topic - '''Corporate Espionage for Dummies: The Hidden Threat of Embedded Web Servers'''&lt;br /&gt;
&lt;br /&gt;
Speaker - VP for Security Research at ZScaler, along with other speakers at the security meetup.&lt;br /&gt;
 &lt;br /&gt;
Today, everything from kitchen appliances to television sets come with an IP address. Network connectivity for various hardware devices opens up exciting opportunities. Forgot to lower the thermostat before leaving the house? Simply access it online. Need to record a show? Start the DVR with a mobile app. While embedded web servers are now as common as digital displays in hardware devices, sadly, security is not. What if that same convenience exposed photocopied documents online or allowed outsiders to record your telephone conversations? A frightening thought indeed.&lt;br /&gt;
 &lt;br /&gt;
Software vendors have been forced to climb the security learning curve. As independent researchers uncovered embarrassing vulnerabilities, vendors had little choice but to plug the holes and revamp development lifecycles to bake security into products. Vendors of embedded web servers have faced minimal scrutiny and as such are at least a decade behind when it comes to security practices. Today, network connected devices are regularly deployed with virtually no security whatsoever.&lt;br /&gt;
 &lt;br /&gt;
The risk of insecure embedded web servers has been amplified by insecure networking practices. Every home and small business now runs a wireless network, but it was likely set up by someone with virtually no networking expertise. As such, many devices designed only for LAN access are now unintentionally Internet facing and wide open to attack from anyone, regardless of their location.&lt;br /&gt;
 &lt;br /&gt;
Leveraging the power of cloud based services, Zscaler spent several months scanning large portions of the Internet to understand the scope of this threat. Our findings will make any business owner think twice before purchasing a 'wifi enabled' device. We'll share the results of our findings, reveal specific vulnerabilities in a multitude of appliances and discuss how embedded web servers will represent a target rich environment for years to come. &lt;br /&gt;
&lt;br /&gt;
 '''December 13, 2011, 6:30, Microsoft NERD, Cambridge, Horace Mann Room'''&lt;br /&gt;
&lt;br /&gt;
'''Jeremiah Grossman – Founder and CTO WhiteHat Security'''&lt;br /&gt;
 &lt;br /&gt;
Directions: http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx&lt;br /&gt;
&lt;br /&gt;
 '''September 14 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Dinis Cruz   -  OWASP O2 Platform'''&lt;br /&gt;
&lt;br /&gt;
The O2 Platform is focused on automating application security knowledge and workflows. It is a library of scriptable objects specifically designed for developers and security consultants to be able to perform quick, effective and thorough source code-driven application security reviews (blackbox + whitebox). &lt;br /&gt;
&lt;br /&gt;
 '''September 7 2011'''&lt;br /&gt;
&lt;br /&gt;
'''Adriel Desautels –  Differences between Penetration Testing and Vulnerability Scanning'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 '''July  2011'''&lt;br /&gt;
&lt;br /&gt;
'''Anurag Agarwal, the founder of MyAppSecurity'''&lt;br /&gt;
&lt;br /&gt;
'''Session 1 - Managing Risk with Threat Modeling''' &lt;br /&gt;
Threat Modeling can help by guiding the Application Development Teams to ensure your Security Policies get properly coded into the Applications at time of Development.  By creating pre-approved methods of coding for your development teams, and applying them in a repeatable and scalable process, you can assist your development teams in building a secure application easily and effortlessly.&lt;br /&gt;
&lt;br /&gt;
'''Session 2 - False Positive, False Negative and False Sense of Security''' &lt;br /&gt;
This interactive session will talk about the pros and cons of using black box testing tools and discuss their effectiveness in building a mature software security program. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday June 2'''&lt;br /&gt;
&lt;br /&gt;
Location - '''Microsoft NERD''' - http://microsoftcambridge.com/About/Directions/tabid/89/Default.aspx &lt;br /&gt;
&lt;br /&gt;
'''Topic - Bringing Sexy Back: Defensive Measures That Actually Work''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Paul Asadoorian, Founder &amp;amp;amp; CEO, PaulDotCom Enterprises &lt;br /&gt;
&lt;br /&gt;
There is a plethora of information available on how to break into systems, steal information, and compromise users. As a penetration tester, I have performed testing on a regular basis that reveals severe security weaknesses in several organizations, and many of my peers have reported on the same. However, once you &amp;quot;own&amp;quot; the network and report on how you accomplished your goals, now what? Sure, we make defensive recommendations, but consistently it has been proven that security can be bypassed. Not enough focus is given to what works defensively. We have a lot of technology at our disposal: firewalls, intrusion detection, log correlation, but it provides little protection from today's threats and is often not implemented effectively. This talk will focus on taking an offensive look at defense. Applying techniques that are simple, yet break the mold of traditional defensive measures. We will explore setting up &amp;quot;traps&amp;quot; for attackers, slowing them down with simple scripts, using honeypots, planting bugs, and most importantly tying these methods to &amp;quot;enterprise security&amp;quot;. This talk will also include real-world examples of the techniques in action from a live, heavily attacked site. Topics will include: &lt;br /&gt;
&lt;br /&gt;
*Using wireless “attacks” on the attackers&lt;br /&gt;
*Implementing the Metasploit Decloak engine to find the attackers&lt;br /&gt;
*Setting traps to detect web application attacks&lt;br /&gt;
*Integrating results into your enterprise log management tool&lt;br /&gt;
&lt;br /&gt;
The goal of this talk is to make defense “sexy”… &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian is currently the &amp;quot;Product Evangelist&amp;quot; for Tenable Network Security, where he showcases vulnerability scanning and management through blogs, podcasts and videos. Paul is also the founder of PaulDotCom, an organization centered around the award winning &amp;quot;PaulDotCom Security Weekly&amp;quot; podcast that brings listeners the latest in security news, vulnerabilities, research and interviews with the security industry's finest. Paul has a background in penetration testing, intrusion detection, and is the co-author of &amp;quot;WRT54G Ultimate Hacking&amp;quot;, a book dedicated to hacking Linksys routers. &lt;br /&gt;
&lt;br /&gt;
 '''Thursday May 26'''&lt;br /&gt;
&lt;br /&gt;
Location - Microsoft Waltham (201 Jones Rd., Sixth Floor Waltham, MA) &lt;br /&gt;
&lt;br /&gt;
'''Topic - OWASP Top 10 issue #4 – Insecure Direct Object Reference''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels and President of OWASP Boston &lt;br /&gt;
&lt;br /&gt;
Jim Weiler will discuss threat models, risks and various remediations of issue #4 in the 2010 OWASP Top 10 – Insecure Direct Object References. &lt;br /&gt;
&lt;br /&gt;
'''Topic - A Web-Application Architecture for Regulatory Compliant Cloud Computing''' &lt;br /&gt;
&lt;br /&gt;
Presenter - Arshad Noor, StrongAuth &lt;br /&gt;
&lt;br /&gt;
The emergence of cloud-computing as an alternative deployment strategy for IT systems presents many opportunities, yet challenges traditional notions of data-security. The fact that data-security regulations are developing teeth, leaves information technology professionals perplexed on how to take advantage of cloud-computing while proving compliance to regulations for protecting sensitive information. &lt;br /&gt;
&lt;br /&gt;
This presentation presents an architecture for building the next generation of web-applications. This architecture allows you to leverage emerging technologies such as cloud-computing, cloud-storage and enterprise key-management (EKM) to derive benefits such as lower costs, faster time-to-market and immense scalability with smaller investments - while proving compliance to PCI-DSS, HIPAA/HITECH and similar data-security regulations. &lt;br /&gt;
&lt;br /&gt;
'''Presenter Bio''' &lt;br /&gt;
&lt;br /&gt;
Arshad Noor is the CTO of StrongAuth, Inc, a Silicon Vally-based company that specializes in enterprise key management. He is the designer and lead-developer of StrongKey, the industry's first open-source Symmetric Key Management System, and the KeyAppliance - the industry's first appliance combining encryption, tokenization, key-management and a cryptographic hardware module at an unprecedented value. He has written many papers and spoken at many forums on the subject of encryption and key-management over the years. &lt;br /&gt;
&lt;br /&gt;
 ''' CANCELLED   ''' &lt;br /&gt;
&lt;br /&gt;
'''Topic – Secure Application design and Coding''' -- CANCELLED &lt;br /&gt;
&lt;br /&gt;
Presenter - Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
'''Speaker Bio ''' &lt;br /&gt;
&lt;br /&gt;
 '''April 2011'''&lt;br /&gt;
&lt;br /&gt;
Ed Adams Security Innovation -- the new OWASP Exams Project and the work being done by the OWASP Academies Working Group &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2011'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 &lt;br /&gt;
&lt;br /&gt;
Owning the world, one mobile app at a time, and web services pen testing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Febrary 2011'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO of Safelight Security - &lt;br /&gt;
&lt;br /&gt;
Security Leadership series: Delivering a successful security presentation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2010'''&lt;br /&gt;
&lt;br /&gt;
Application Architecture Security Assessment - Second session &lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2010'''&lt;br /&gt;
&lt;br /&gt;
Open SAMM – Software Assurance Maturity Model &lt;br /&gt;
&lt;br /&gt;
Shakeel Tufail is the Federal Practice Manager at Fortify, an HP company. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne, CEO SafeLight Security Advisors Overview: In this highly interactive two-part workshop, Rob Cheyne of Safelight Security will show you the basics of conducting a real-world architecture &amp;amp;amp; design review. This workshop draws from Safelight's Security Architecture Fundamentals training course, a two-day course frequently used to teach Fortune 500 companies how to look at their system architectures from both the hacker's and the designer’s point of view. &lt;br /&gt;
&lt;br /&gt;
 '''July 2010'''&lt;br /&gt;
&lt;br /&gt;
Lightning Talk – Rob Cheyne, CEO Safelight Security Advisors In this installment of the Safelight lightning talks series, Rob will present the basics of a Cross-site Request Forgery (CSRF). &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Drive-by Pharming with MonkeyFist &lt;br /&gt;
&lt;br /&gt;
Joey Peloquin - Director of Application Security, Fishnet Security &lt;br /&gt;
&lt;br /&gt;
 '''June 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - topic to be announced &lt;br /&gt;
&lt;br /&gt;
Main Presentation - Ryan Barnett The Web Hacking Incident Database (WHID) is a Web Application Security Consortium project dedicated to maintaining a list of web applications related security incidents. Ryan Barnett is director of application security research at Breach Security where he leads Breach Security Labs. &lt;br /&gt;
&lt;br /&gt;
 '''May 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne Lightning Talk - SQL Injection &lt;br /&gt;
&lt;br /&gt;
Vinnie Liu - Data Exposure, New Approaches to Open Source Intelligence Techniques, and Incident Handling &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2010'''&lt;br /&gt;
&lt;br /&gt;
Dan Hestad Security Innovation Dan will be talking about his experiences with PCI and web applications, and answering questions about do's and don'ts of acceptable PCI practices in web applications. &lt;br /&gt;
&lt;br /&gt;
 '''March 2010'''&lt;br /&gt;
&lt;br /&gt;
Zack Lanier - Disclosure Samsara, or &amp;quot;the endless vulnerability disclosure debate&amp;quot; &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.html &lt;br /&gt;
&lt;br /&gt;
http://n0where.org/talks/samsara_20100310.pdf (very large PDF) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2010'''&lt;br /&gt;
&lt;br /&gt;
Rob Cheyne of Safelight Security Advisors; New Technology, Same Old Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2010 at Microsoft NERD, Cambridge'''&lt;br /&gt;
&lt;br /&gt;
Josh Abraham, Rapid 7 Technologies &lt;br /&gt;
&lt;br /&gt;
 '''December 2009'''&lt;br /&gt;
&lt;br /&gt;
Eric Bender, Cenzic &lt;br /&gt;
&lt;br /&gt;
 '''November 2009'''&lt;br /&gt;
&lt;br /&gt;
Jim Weiler, Sr. Mgr. Information Security, Starwood Hotels - Web Application Vulnerability Scanners &lt;br /&gt;
&lt;br /&gt;
Mush Hakhinian, Leader, Application Security Practice, IntraLinks - Secure coding with no money down using SONAR: unleashing the power of open-source code analysis tools &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2009'''&lt;br /&gt;
&lt;br /&gt;
Paul Schofield, Senior Security Engineer, Imperva - From Rivals to BFF: WAF &amp;amp;amp; VA Unite &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2009 at CORE Technologies, Boston'''&lt;br /&gt;
&lt;br /&gt;
Paul Asadoorian, Pauldotcom.com &lt;br /&gt;
&lt;br /&gt;
Alex Horan, CORE Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2009'''&lt;br /&gt;
&lt;br /&gt;
Joey Peloquin, Fishnet Security, Secure SDLC: The Good, the Bad and the Ugly [http://www.owasp.org/images/4/48/SecureSDLC-GoodBadUgly.pdf presentation pdf] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2009'''&lt;br /&gt;
&lt;br /&gt;
Sabha Kazerooni, Security Compass - Exploit Me tools; Framework Level Threat Analysis &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/5/5a/Security_Compass_Exploilt_Me.pdf ExploitMe Document] &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/images/e/ef/Security_Compass_Framework-level_Threat_Analysis.pdf Framework Level Threat Analysis document] &lt;br /&gt;
&lt;br /&gt;
Meeting Pizza Sponsor - Arcot &lt;br /&gt;
&lt;br /&gt;
Arcot is a leader in online fraud prevention, strong authentication and eDocument security. Arcot's solutions are easily deployed, low-cost and extremely scalable, allowing organizations to transparently protect their users from fraud without changing user behavior or requiring expensive hardware. &lt;br /&gt;
&lt;br /&gt;
Arcot can be contacted thru Michael Kreppein, michael.kreppein@arcot.com, 617-467-5200 &lt;br /&gt;
&lt;br /&gt;
 '''December 2008'''&lt;br /&gt;
&lt;br /&gt;
Brian Holyfield, Gothem Digital Science &lt;br /&gt;
&lt;br /&gt;
Tamper Proofing Web Applications http://www.gdssecurity.com/l/b/2008/12/04/ &lt;br /&gt;
&lt;br /&gt;
 '''June 2008'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman; Founder and CTO, Whitehat Security &lt;br /&gt;
&lt;br /&gt;
Appetizer - Hacking Intranets from the Outside (Just when you thought your network was safe) Port scanning with JavaScript &lt;br /&gt;
&lt;br /&gt;
Main Topic - Business Logic Flaws: How they put your Websites at Risk &lt;br /&gt;
&lt;br /&gt;
 '''March 2008'''&lt;br /&gt;
&lt;br /&gt;
Chris Eng; Senior Director, Security Research, Veracode &lt;br /&gt;
&lt;br /&gt;
Description – Attacking crypto in web applications &lt;br /&gt;
&lt;br /&gt;
 '''December 2007'''&lt;br /&gt;
&lt;br /&gt;
Scott Matsumoto; Principal Consultant, Cigital &lt;br /&gt;
&lt;br /&gt;
Description – You Say Tomayto and I Say Tomahto – Talking to Developers about Application Security &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/5/5b/BostonOWASP200712-Cigital.pdf Cigital Presentation] &lt;br /&gt;
&lt;br /&gt;
 '''November 2007'''&lt;br /&gt;
&lt;br /&gt;
Tom Mulvehill Ounce Labs &lt;br /&gt;
&lt;br /&gt;
Description – Tom will share his knowledge and expertise on implementing security into the software development life cycle. This presentation will cover how to bring practicality into secure software development. Several integration models will be explored as well as solutions for potential obstacles &lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/images/f/f8/Ounce_OWASP_07NOV07ppt.zip Ounce presentation] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2007'''&lt;br /&gt;
&lt;br /&gt;
George Johnson, Principal Software Engineer EMC; CISSP &lt;br /&gt;
&lt;br /&gt;
An Introduction to Threat Modeling. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2007'''&lt;br /&gt;
&lt;br /&gt;
Day of Worldwide OWASP 1 day conferences on the topic &amp;quot;Privacy in the 21st Century&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 '''June 2007'''&lt;br /&gt;
&lt;br /&gt;
Tool Talk - Jim Weiler - WebGoat and Crosssite Request Forgeries &lt;br /&gt;
&lt;br /&gt;
Danny Allan; Director, Security Research, Watchfire &lt;br /&gt;
&lt;br /&gt;
Topic: Exploitation of the OWASP Top 10: Attacks and Strategies &lt;br /&gt;
&lt;br /&gt;
 '''March 2007'''&lt;br /&gt;
&lt;br /&gt;
Jeremiah Grossman, CTO Whitehat Security: Top 10 Web Application Hacks of 2006 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2007'''&lt;br /&gt;
&lt;br /&gt;
Dave Low, RSA the Security Division of EMC: encryption case studies &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2006'''&lt;br /&gt;
&lt;br /&gt;
Mike Gavin, Forrester Research: Web Application Firewalls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''June 2006'''&lt;br /&gt;
&lt;br /&gt;
Imperva - Application and Database Vulnerabilities and Intrusion Prevention &lt;br /&gt;
&lt;br /&gt;
Jim Weiler - Using Paros Proxy Server as a Web Application Vulnerability tool &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2006'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2006'''&lt;br /&gt;
&lt;br /&gt;
Dennis Hurst; SPI Dynamics: A study of AJAX Hacking &lt;br /&gt;
&lt;br /&gt;
Jim Weiler; OWASP Boston: Using Paros HTTP proxy, part 1. first meeting with all demos, no powerpoints! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2006'''&lt;br /&gt;
&lt;br /&gt;
Mateo Meucci; OWASP Italy [http://www.owasp.org/images/8/8c/Anatomy_of_2_Web_App_Testing.zip Anatomy of 2 web attacks] &lt;br /&gt;
&lt;br /&gt;
Tom Stracener; Cenzic Web Application Vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''February 2006'''&lt;br /&gt;
&lt;br /&gt;
Ron Ben Natan; Guardium CTO Database Security: Protecting Identity Information at the Source &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''January 2006'''&lt;br /&gt;
&lt;br /&gt;
David Low, Senior Field Engineer: RSA Practical Encryption &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''December 2005'''&lt;br /&gt;
&lt;br /&gt;
Paul Galwas, Product Manager: nCipher [http://www.owasp.org/docroot/owasp/misc/OWASP051207.ppt Enigma variations: Key Management controlled] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''November 2005'''&lt;br /&gt;
&lt;br /&gt;
Robert Hurlbut, Independent Consultant [http://www.owasp.org/docroot/owasp/misc/OWASP_Hurlbut_ThreatModelingforWebApplicaitons.zip Threat Modeling for web applications] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''October 2005'''&lt;br /&gt;
&lt;br /&gt;
Prateek Mishra, Ph.D. Director, Security Standards and Strategy: Oracle Corp Chaiman of the OASIS Security Services (SAML) Technical Committee - [http://www.owasp.org/docroot/owasp/misc/Federation-Introduction-Overview-01.ppt Identity Federation&amp;amp;nbsp;: Prospects and Challenges] &lt;br /&gt;
&lt;br /&gt;
Ryan Shorter, Sr. System Engineer: Netcontinuum - Application Security Gateways &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''September 2005'''&lt;br /&gt;
&lt;br /&gt;
Dr. Herbert Thompson, Chief Security Strategist: SecurityInnovation - How to Break Software Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''July 2005'''&lt;br /&gt;
&lt;br /&gt;
Mark O'Neill, CTO: Vordel - [http://www.owasp.org/docroot/owasp/misc/MarkOneill.pdf Giving SOAP a REST? A look at the intersection of Web Application Security and Web Services Security] &lt;br /&gt;
&lt;br /&gt;
 '''June 2005'''&lt;br /&gt;
&lt;br /&gt;
Arian Evans, National Practice Lead, Senior Security Engineer: Fishnet Security [http://www.owasp.org/conferences/appsec2005dc/schedule.html Overview of Application Security Tools] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''May 2005'''&lt;br /&gt;
&lt;br /&gt;
Patrick Hynds, CTO: Critical Sites - [http://www.owasp.org/docroot/owasp/misc/Passwords-Keys_to_the_Kingdom_Dev_V1.ppt Passwords - Keys to the Kingdom] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''April 2005'''&lt;br /&gt;
&lt;br /&gt;
Jonathan Levin - [http://www.owasp.org/docroot/owasp/misc/JLevinRandoms.pdf Of Random Numbers] &lt;br /&gt;
&lt;br /&gt;
Jothy Rosenberg, Founder and CTO: Service Integrity - [http://www.owasp.org/docroot/owasp/misc/JothyRWebSvcsSec.ppt Web Services Security] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''March 2005'''&lt;br /&gt;
&lt;br /&gt;
Joe Stagner: Microsoft Let's talk about Application Security &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 '''Feb 2005'''&lt;br /&gt;
&lt;br /&gt;
Application Security Inc. PowerPoint slides for the [http://www.owasp.org/docroot/owasp/misc/Anatomy+of+an+Attack.ppt Anatomy of a Database Attack.] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Local Chapter Information ==&lt;br /&gt;
&lt;br /&gt;
To find out more about the Boston chapter, just join the [http://lists.owasp.org/mailman/listinfo/owasp-boston OWASP Boston mailing list]. &lt;br /&gt;
&lt;br /&gt;
The chapter shipping/mailing address is: &lt;br /&gt;
&lt;br /&gt;
OWASP Boston &amp;lt;br/&amp;gt;&lt;br /&gt;
35 Wachusett Dr &amp;lt;br/&amp;gt;&lt;br /&gt;
Lexington, MA 02421 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Reviews_of_security_podcasts Reviews of security podcasts] &lt;br /&gt;
&lt;br /&gt;
[[2012 BASC Homepage|Boston Application Security Conference 2012]] &lt;br /&gt;
&lt;br /&gt;
[[2011 BASC Homepage|Boston Application Security Conference 2011]] &lt;br /&gt;
&lt;br /&gt;
[[2010 BASC Homepage|Boston Application Security Conference 2010]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Boston OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
'''President''' &lt;br /&gt;
&lt;br /&gt;
- [mailto:jim.weiler@owasp.org Jim Weiler] 781 356 0067 &lt;br /&gt;
&lt;br /&gt;
'''Board of Directors''' &lt;br /&gt;
&lt;br /&gt;
* Linda Leigh Aberdale&lt;br /&gt;
* Mark Arnold &lt;br /&gt;
* [mailto:tom.conner@owasp.org Tom Conner]&lt;br /&gt;
* Mike Perez &lt;br /&gt;
* [mailto:roy.wattanasin@owasp.org Roy Wattanasin]&lt;br /&gt;
* Pedro Marcano&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
[[Category:Boston]] [[Category:OWASP_Chapter]] [[Category:Massachusetts]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217745</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217745"/>
				<updated>2016-06-07T02:52:28Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. The marketing logic could have 30 or 40 different vendor tags on a single page. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen. &lt;br /&gt;
Changing third party vendors just means changing the data dissemination rules at the tag manager server, no changes are needed in the host code.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to connect to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217744</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217744"/>
				<updated>2016-06-07T02:43:58Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code to send data layer data on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes. No interaction is needed with the third parties; they continue getting the data they expect but now it comes from different contexts that the host marketing technologists have chosen.&lt;br /&gt;
The data also goes directly only to the tag manager so the execution is fast. The event handler javascript does not have to send to multiple third party sites.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217743</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217743"/>
				<updated>2016-06-07T02:32:17Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code on each page to send data layer data is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217742</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217742"/>
				<updated>2016-06-07T02:30:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, a javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. The event handler code is loaded from the tag manager servers on every page load.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217741</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217741"/>
				<updated>2016-06-07T02:23:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
This is also a very scaleable solution. Large ecommerce sites can easily have hundreds of thousands of URL and parameter combinations, with different sets of URLs and parameters being included in different marketing analysis campaigns. For example user actions in pages about specified cities, from specified locations on specified days should send data layer elements 1, 2 and 3.  User actions in pages about other cities should send data layer elements 2 and 3 only. Since the event handler code on each page is controlled by the host developers or marketing technologists using the tag manager developer interface, the business logic about when and what data layer elements are sent to the tag manager server, can be changed and deployed in minutes.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217740</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217740"/>
				<updated>2016-06-07T01:58:19Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; first to populate the data layer (generally on page load); then event handler javascript sends whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217739</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217739"/>
				<updated>2016-06-07T01:54:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page. The data layer is created by the host developers.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217738</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217738"/>
				<updated>2016-06-07T01:52:45Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it.&lt;br /&gt;
&lt;br /&gt;
The data layer is created by the host developers. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217737</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217737"/>
				<updated>2016-06-07T01:52:21Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it.&lt;br /&gt;
&lt;br /&gt;
The data layer is created by the host developers. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217736</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217736"/>
				<updated>2016-06-07T01:51:06Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element or the description of a user action. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
When specific events happen that the business has defined, the javascript handler for that event sends values from the data layer directly to the tag manager server. The tag manager server then sends the data to whatever third party or parties is supposed to get it.&lt;br /&gt;
&lt;br /&gt;
The data layer is created by the host developers. The event handler code is created by the host developers using the tag manager developer user interface. &lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217734</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217734"/>
				<updated>2016-06-07T01:37:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. &lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217733</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217733"/>
				<updated>2016-06-07T01:37:15Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to create javascript that can get data from anywhere in the browser DOM and store it anywhere on the page. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
'''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217732</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217732"/>
				<updated>2016-06-07T01:28:39Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
To create a data layer, the host site owner  generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217730</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217730"/>
				<updated>2016-06-07T01:26:28Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
To create a data layer, the host site owner  generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  &lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217729</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217729"/>
				<updated>2016-06-07T01:24:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to make the generated code secure is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
To create a data layer, the host site owner  generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217728</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217728"/>
				<updated>2016-06-07T01:21:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to constrain the generated code is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
To create a data layer, the host site owner  generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217727</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217727"/>
				<updated>2016-06-07T01:18:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Server Direct Data Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to constrain the generated code is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
With this mechanism, only the javascript you (the host site owner) generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
User interface tags cannot be made secure using the data layer architecture because their function (or one of their functions) is to change the user interface on the client, not to send data about the user actions.&lt;br /&gt;
&lt;br /&gt;
Analytics tags can be made secure using the data layer architecture because the only action needed is to send data from the data layer to the third party. Only first party code is executed; to populate the data layer then to send whatever data is needed from that page to the third party database or tag manager.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217725</id>
		<title>3rd Party Javascript Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=3rd_Party_Javascript_Management_Cheat_Sheet&amp;diff=217725"/>
				<updated>2016-06-07T01:16:02Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Third party vendor javascript ('''tags''') tags can be divided into two types: user interface tags and analytic tags.&lt;br /&gt;
&lt;br /&gt;
User interface tags have to execute on the client because they change the DOM; displaying a dialog or image or changing text etc. &lt;br /&gt;
&lt;br /&gt;
Analytics tags send information back to a marketing information database; information like what user action was just taken, browser metadata, location information, page metadata etc.   &lt;br /&gt;
The rationale for analytics tags is to provide data from the user's browser DOM to the vendor for some form of marketing analysis. This data can be anything available in the DOM. The data is used for user navigation and clickstream analysis, identification of the user to determine further content to display etc., and various marketing analysis functions. &lt;br /&gt;
&lt;br /&gt;
The term '''host''' refers to the original site the user goes to, such as a shopping or news site, that contains or retrieves and executes third party javascript tag for marketing analysis of the user actions.&lt;br /&gt;
&lt;br /&gt;
=  Major risks =&lt;br /&gt;
&lt;br /&gt;
The invocation of 3rd party JS code in a web application requires consideration for 3 risks in particular:&lt;br /&gt;
# The loss of control over changes to the client application,&lt;br /&gt;
# The execution of arbitrary code on client systems,&lt;br /&gt;
# The disclosure or leakage of sensitive information to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
== Risk 1: Loss of control over changes to the client application ==&lt;br /&gt;
This risk arises from the fact that there is usually no guaranty that the code hosted at the 3rd party will remain the same as seen from the developers and testers: new features may be pushed in the 3rd party code at any time, thus potentially breaking the interface or data-flows and exposing the availability of your application to its users/customers.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception) and secure transmission of the 3rd party code (to prevent modifications while in-transit). See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 2: Execution of arbitrary code on client systems ==&lt;br /&gt;
This risk arises from the fact that 3rd party JavaScript code is rarely reviewed by the invoking party prior to its integration into a website/application. As the client reaches the hosting website/application, this 3rd party code gets executed, thus granting the 3rd party the exact same privileges that were granted to the user (similar to [[Cross-site_Scripting_(XSS)|XSS attacks]]).&lt;br /&gt;
&lt;br /&gt;
Any testing performed prior to entering production loses some of its validity, including *AST testing (IAST, RAST, SAST, DAST, etc.). While it is widely accepted that the probability of having rogue code intentionally injected by the 3rd party is low, there are still cases of malicious injections in 3rd party code after the organization's servers were compromised (Yahoo, January 2014). This risk should therefore still be evaluated, in particular when the 3rd party does not show any documentation that it is enforcing better security measures than the invoking organization itself, or at least equivalent. Another example is that the domain hosting the 3rd party JavaScript code expires because the company maintaining it is bankrupt or the developers have abandoned the project. A malicious actor can then re-register the domain and publish malicious code.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent alterations by 3rd parties), sub-resource integrity (to enable browser-level interception), secure transmission of the 3rd party code (to prevent modifications while in-transit) and various types of sandboxing. See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Risk 3: Disclosure of sensitive information to 3rd parties ==&lt;br /&gt;
When a 3rd party script is invoked in a website/application, the browser directly contacts the 3rd party servers. By default, the request includes all regular HTTP headers. In addition to the originating IP address of the browser, the 3rd party also obtains other data such as the referrer (in non-https requests) and any cookies previously set by the 3rd party, for example when visiting another organization's website that also invokes the 3rd party script.&lt;br /&gt;
&lt;br /&gt;
In many cases, this grants the 3rd party primary access to information on the organization's users / customers / clients. Additionally, if the 3rd party is sharing the script with other entities, it also collects secondary data from all the other entities, thus knowing who the organization's visitors are but also what other organizations they interact with.&lt;br /&gt;
&lt;br /&gt;
A typical case is the current situation with major news/press sites that invoke 3rd party code (typically for ad engines, statistics and JavaScript APIs): any user visiting any of these websites also informs the 3rd parties of the visit. In many cases, the 3rd party also gets to know what news articles each individual user is clicking specifically (leakage occurs through the HTTP referrer field) and thus can establish deeper personality profiles.&lt;br /&gt;
&lt;br /&gt;
Typical defenses include, but are not restricted to: in-house script mirroring (to prevent leakage of HTTP requests to 3rd parties). Users can reduce their profiling by random clicking links on leaking websites/applications (such as press/news websites) to reduce profiling. See below for more details.&lt;br /&gt;
&lt;br /&gt;
= 3rd Party JavaScript Deployment Architectures =&lt;br /&gt;
&lt;br /&gt;
There are three basic deployment mechanisms for third party vendor javascript, or ''''tags''''. These mechanisms can be combined with each other.&lt;br /&gt;
&lt;br /&gt;
== Vendor Javascript on page ==&lt;br /&gt;
&lt;br /&gt;
This is where the vendor provides the host with the javascript and the host puts it on the host page. To be secure the host company must review the code for any vulnerabilities like [[Cross-site_Scripting_(XSS)|cross site scripting]] or malicious actions such as sending sensitive data from the DOM to a malicious site. This is often difficult because the javascript is commonly obfuscated.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;/* 3rd party vendor javascript here */&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript Request to Vendor == &lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL directly from the vendor site. When the host page is being created, the developer includes the lines of code provided by the vendor that will request the vendor javascript. Each time the page is accessed the requests are made to the vendor site for the javascript, which then executes on the user browser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. foobar.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Indirect request to Vendor through Tag Manager ==&lt;br /&gt;
&lt;br /&gt;
This is where one or a few lines of code on the host page each request a javascript file or URL from a tag aggregator or tag manager site; not from the javascript vendor site. The tag aggregator or tag manager site returns whatever third party javascript files that the host company has configured to be returned. Each file or URL request to the tag manager site can return lots of other javascript files from multiple vendors.&lt;br /&gt;
&lt;br /&gt;
The actual content that is returned from the aggregator or manager (i.e. the specific javascript files as well as exactly what they do) can be dynamically changed by host site employees using a graphical user interface for development, hosted on the tag manager site that non-technical users can work with, such as the marketing part of the business. The changes can be either 1. get a different javascript file from the 3rd party vendor for the same request; 2. change what DOM object data is read, and when, to send to the vendor. &lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface will generate code that does what the marketing functionality requires, basically determining what data to get from the browser DOM and when to get it. The tag manager always returns a 'container' javascript file to the browser which is basically a set of javascript functions that are used by the code generated by the user interface to implement the required functionality. Similar to java frameworks that provide functions and global data to the developer, the container javascript executes on the browser and lets the business user use the tag manager developer user interface to specify high level functionality without needing to know javascript.&lt;br /&gt;
&lt;br /&gt;
=== Security Problems with requesting Tags ===&lt;br /&gt;
&lt;br /&gt;
Previously described mechanisms are difficult to make secure because you can only see the code if you proxy the requests or if you get access to the GUI and see what is configured. The javascript is generally obfuscated so even seeing it is usually not useful. It is also instantly deployable because each new page request from a browser executes the requests to the aggregator which gets the javascript from the third party vendor. So as soon as any javascript files are changed on the vendor, or modified on the aggregator, the next call for them from any browser will get the changed javascript. This risk can be managed with the &amp;lt;i&amp;gt;Subresource Integrity&amp;lt;/i&amp;gt; standard described below.&lt;br /&gt;
&lt;br /&gt;
==  Server Direct ==&lt;br /&gt;
&lt;br /&gt;
The tag manager developer user interface can be used to get data from anywhere in the browser DOM. This can allow vulnerabilities because the interface can be used to generate code to get unvalidated data from the DOM (e.g. URL parameters) and store it in some page location that would execute javascript. &lt;br /&gt;
&lt;br /&gt;
The best way to constrain the generated code is to confine it to getting DOM data from a host defined data layer.&lt;br /&gt;
&lt;br /&gt;
With this mechanism, only the javascript you (the host site owner) generate using the tag manager developer user interface will get and send data values to the tag manager or tag aggregator site which then sends the data to vendors. '''This the most secure technique''' because only your javascript executes on your users browser, and only the data you decide on is sent to the vendor.&lt;br /&gt;
&lt;br /&gt;
This requires cooperation between the host, the aggregator or tag manager and the vendors. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the vendor in order to know what type of data the vendor needs to do their analysis. Then the host programmer determines what DOM element will have that data. &lt;br /&gt;
&lt;br /&gt;
The host developers have to work with the tag manager or aggregator to agree on the protocol to send the data to the aggregator: what URL, parameters, format etc.&lt;br /&gt;
&lt;br /&gt;
The tag manager or aggregator has to work with the vendor to agree on the protocol to send the data to the vendor: what URL, parameters, format etc. Does the vendor have an API?&lt;br /&gt;
&lt;br /&gt;
= Security Defense Considerations = &lt;br /&gt;
&lt;br /&gt;
== Server Direct Data Layer ==&lt;br /&gt;
&lt;br /&gt;
The server direct mechanism is a good security standard for third party javascript management, deployment and execution.  A good practice for the host page is to create a data layer of DOM objects. The data layer is either (1) a DIV object with attribute values that have the marketing or user behavior data that the 3rd party wants or (2) a set of JSON objects with the same data.  Each variable or attribute contains the value of some DOM element. The data layer is the complete set of values that all vendors need for that page.&lt;br /&gt;
&lt;br /&gt;
The data layer can also perform any validation of the values, especially values from DOM objects exposed to the user like URL parameters and input fields, if these are required for the marketing analysis.&lt;br /&gt;
&lt;br /&gt;
An example statement for a corporate standard document is  'The tag javascript can only access values in the host data layer. The tag javascript can never access a URL parameter.&lt;br /&gt;
&lt;br /&gt;
You the host page developer have to agree with the 3rd party vendors or the tag manager what attribute in the data layer will have what value so they can create the javascript to read that value.&lt;br /&gt;
&lt;br /&gt;
== Indirect Requests ==&lt;br /&gt;
&lt;br /&gt;
For indirect requests to tag manager/aggregator sites that offer the GUI to configure the javascript, they may also implement technical controls such as only allowing the javascript to access the data layer values, no other DOM element. The host company should also verify the security practices of the tag manager site such as access controls to the tag configuration for the host company. &lt;br /&gt;
&lt;br /&gt;
Letting the marketing folks decide where to get the data they want can result in XSS because they may get it from a URL parameter and put it into a variable that is in a scriptable location on the page.&lt;br /&gt;
&lt;br /&gt;
== Sandboxing Content == &lt;br /&gt;
&lt;br /&gt;
Both of these tools be used by sites to sandbox/clean DOM data.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/cure53/DOMPurify DOMPurify] is a fast, tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.&lt;br /&gt;
* [https://github.com/hackvertor/MentalJS MentalJS] is a JavaScript parser and sandbox. It whitelists JavaScript code by adding a &amp;quot;$&amp;quot; suffix to variables and accessors.&lt;br /&gt;
&lt;br /&gt;
== Subresource Integrity ==&lt;br /&gt;
&lt;br /&gt;
[https://www.w3.org/TR/SRI/ Subresource Integrity] will ensure that only the code that has been reviewed is executed. The developer generates integrity metadata for the vendor javascript, and adds it to the script element like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot; &lt;br /&gt;
   integrity=&amp;quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC7CGiSNE64QUbHNPhzk8Xhm0djE6QqTpL0HzTUxk&amp;quot;&lt;br /&gt;
   crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to know that in order for SRI to work, the vendor host needs [https://www.w3.org/TR/cors/ CORS] enabled. Also it is good idea to monitor vendor javascript for changes in regular way. Because somitime you can get '''secure''' but '''not working''' 3rd party code when vendor decides to update it.&lt;br /&gt;
&lt;br /&gt;
== Keeping JavaScript libraries updated ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities OWASP Top 10 2013 A9] describes the problem of using components with known vulnerabilities. This includes JavaScript libraries. JavaScript libraries must be kept up to date, as previous version can have known vulnerabilities which can lead to the site typically being vulnerable to [[Cross-site_Scripting_(XSS)|Cross Site Scripting]]. There are several tools out there that can help identify such libraries. One such tool is the free open source tool [https://retirejs.github.io RetireJS]&lt;br /&gt;
&lt;br /&gt;
== Sandboxing with iframe ==&lt;br /&gt;
&lt;br /&gt;
You can also put vendor javascript into an iframe from different domain (e.g. static data host). It will work as a &amp;quot;jail&amp;quot;&lt;br /&gt;
and vendor javascript will not have direct access to the host page DOM and cookies. The host main page and sandbox iframe can communicate between each other via the [https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage postMessage mechanism].&lt;br /&gt;
Also, iframes can be secured with the iframe [http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ sandbox attribute]. For high risk applications, consider the use of [https://www.w3.org/TR/CSP2/ Content Security Policy (CSP)] in addition to iframe sandboxing. CSP makes hardening against XSS even stronger.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- Some host, e.g. somehost.com, HTML code here --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...    &lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- Include iframe with 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;iframe src=&amp;quot;https://somehost-static.net/analytics.html&amp;quot; sandbox=&amp;quot;allow-same-origin allow-scripts&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!-- somehost-static.net/analytics.html --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
     &amp;lt;body&amp;gt;&lt;br /&gt;
       ...&lt;br /&gt;
       &amp;lt;script&amp;gt;&lt;br /&gt;
       window.addEventListener(&amp;quot;message&amp;quot;, receiveMessage, false);&lt;br /&gt;
       function receiveMessage(event) {&lt;br /&gt;
         if (event.origin !== &amp;quot;https://somehost.com:443&amp;quot;) {&lt;br /&gt;
           return;&lt;br /&gt;
         } else {&lt;br /&gt;
         // Make some DOM here and initialize other data required for 3rd party code&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       &amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- 3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
       &amp;lt;script src=&amp;quot;https://analytics.vendor.com/v1.1/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &amp;lt;nowiki&amp;gt;&amp;lt;!-- /3rd party vendor javascript --&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Vendor Agreements ==&lt;br /&gt;
&lt;br /&gt;
You can have the agreement with the 3rd parties say that they have to implement and prove secure coding and general corporate security.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
https://randywestergren.com/widespread-xss-vulnerabilities-ad-network-code-affecting-top-tier-publishers-retailers/&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
[[User:jweiler|Jim Weiler]] - Jim.Weiler@owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=212947</id>
		<title>User:Jweiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Jweiler&amp;diff=212947"/>
				<updated>2016-04-12T02:30:06Z</updated>
		
		<summary type="html">&lt;p&gt;Jweiler: Created page with &amp;quot;I started programming in Fortran in 1970. I wrote a COBOL program as an undergraduate. I actually wrote a program in APL at UMASS Amherst in 1978 as a graduate student. I put...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started programming in Fortran in 1970. I wrote a COBOL program as an undergraduate. I actually wrote a program in APL at UMASS Amherst in 1978 as a graduate student. I put a 'Hello World' website from my portable computer at work on the internet without a firewall in 1996, just for a few hours, and just an IP address, no DNS name. &lt;br /&gt;
In 2005 I started the Boston OWASP chapter, and am still running it. &lt;br /&gt;
Currently (April 2016) I'm the application security architect for Starwood Hotels.&lt;/div&gt;</summary>
		<author><name>Jweiler</name></author>	</entry>

	</feed>