Content Security Policy ( CSP ) is a computer security standard introduced to prevent cross-site scripting (XSS), clickjacking and other code injection attacks resulting from execution of malicious content in the trusted web page context. It is a Candidate Recommendation of the W3C working group on Web Application Security, widely supported by modern web browsers . CSP provides a standard method for website owners to declare approved origins of content that browsers should be allowed to load on that website—covered types are JavaScript , CSS , HTML frames , web workers , fonts , images, embeddable objects such as Java applets , ActiveX , audio and video files, and other HTML5 features.
50-456: The standard, originally named Content Restrictions, was proposed by Robert Hansen in 2004, first implemented in Firefox 4 and quickly picked up by other browsers. Version 1 of the standard was published in 2012 as W3C candidate recommendation and quickly with further versions (Level 2) published in 2014. As of 2023, the draft of Level 3 is being developed with the new features being quickly adopted by
100-662: A MediaWiki wiki that seeks to document open web standards called the WebPlatform and WebPlatform Docs. In January 2013, Beihang University became the Chinese host. In 2022 the W3C WebFonts Working Group won an Emmy Award from the National Academy of Television Arts and Sciences for standardizing font technology for custom downloadable fonts and typography for web and TV devices. On 1 January 2023, it reformed as
150-546: A new user interface , with a new look designed to make it faster. Early mockups of the new interface on Windows , Mac OS X , and Linux were first made available in July 2009. New features included improved "doorhanger" notifications, Firefox Panorama (a feature that lets the user visually group tabs), application tabs, a redesigned extension manager, Jetpack extensions support, integration with Firefox Sync , and support for multitouch displays. Many changes were made to
200-521: A new JavaScript engine ( JägerMonkey ) and better XPCOM APIs. JägerMonkey is a new JavaScript engine designed to work alongside the TraceMonkey engine introduced with Firefox 3.5. It improves performance by compiling "non-traceable" JavaScript into machine language for faster execution. Firefox 4 is the first version of Firefox to drop native support of the Gopher protocol ; however, continued support
250-599: A new edition or level of the recommendation. Additionally, the W3C publishes various kinds of informative notes which are to be used as references. Unlike the Internet Society and other international standards bodies, the W3C does not have a certification program. The W3C has decided, for now, that it is not suitable to start such a program, owing to the risk of creating more drawbacks for the community than benefits. In January 2023, after 28 years of being jointly administered by
300-492: A number of features are disabled by default: While using CSP in a new application may be quite straightforward, especially with CSP-compatible JavaScript framework, existing applications may require some refactoring—or relaxing the policy. Recommended coding practice for CSP-compatible web applications is to load code from external source files ( <script src> ), parse JSON instead of evaluating it and use EventTarget.addEventListener() to set event handlers. Any time
350-456: A public-interest 501(c)(3) non-profit organization . W3C develops technical specifications for HTML5 , CSS , SVG , WOFF , the Semantic Web stack , XML , and other technologies. Sometimes, when a specification becomes too large, it is split into independent modules that can mature at their own pace. Subsequent editions of a module or specification are known as levels and are denoted by
400-407: A requested resource or script execution violates the policy, the browser will fire a POST request to the value specified in report-uri or report-to containing details of the violation. CSP reports are standard JSON structures and can be captured either by application's own API or public CSP report receivers. In 2018 security researchers showed how to send false positive reports to
450-462: A working draft (WD) for review by the community. A WD document is the first form of a standard that is publicly available. Commentary by virtually anyone is accepted, though no promises are made with regard to action on any particular element commented upon. At this stage, the standard document may have significant differences from its final form. As such, anyone who implements WD standards should be ready to significantly modify their implementations as
500-497: Is a version of the Firefox web browser , released on March 22, 2011. The first beta was made available on July 6, 2010; Release Candidate 2 (a base for the final version) was released on March 18, 2011. It was codenamed Tumucumaque , and was Firefox's last large release cycle. The Mozilla team planned smaller and quicker releases following other browser vendors. The primary goals for this version included improvements in performance, standards support, and user interface. There
550-439: Is available through an add-on . Firefox 4 introduces an audio API , which provides a way to programmatically access or create audio data associated with an HTML5 audio element. It allows, for example, to visualize raw sound data, to use filters or to show the audio spectrum. Firefox 4 no longer relies on the underlying OS for text layout/shaping. Instead, it uses HarfBuzz . This allows for smart OpenType layout/shaping which
SECTION 10
#1732894563768600-580: Is consistent across different operating systems. Firefox 4 has marked a major change in performance in comparison to former versions 3.6 and 3.5. The browser has made significant progress in Sunspider JavaScript tests as well as improvements in supporting HTML5. Since Firefox 4.0 Beta 5, hardware acceleration of content is enabled by default on Windows Vista and Windows 7 machines using Direct2D , on OS X using Quartz (basically CPU-only), and Linux using XRender . Hardware acceleration of compositing
650-403: Is done by external experts in the W3C's various working groups. The Consortium is governed by its membership. The list of members is available to the public. Members include businesses, nonprofit organizations, universities, governmental entities, and individuals. Membership requirements are transparent except for one requirement: An application for membership must be reviewed and approved by
700-458: Is enabled by default on Windows XP, Windows Vista and Windows 7 machines using Direct3D , OS X and Linux using OpenGL . Using hardware acceleration allows the browser to tap into the computer's graphics processing unit , lifting the burden from the CPU and speeding up the display of web pages. Acceleration is only enabled for certain graphics hardware and drivers. One of the performance optimizations
750-505: Is hidden by default with the most common actions moved to a new "Firefox" menu in the upper left-hand corner of the browser. Users can create persistent "app tabs", and customize the tab bar, as well as the bookmark and navigation bars. Many of these features are similar to ones introduced by Google Chrome . Firefox 4 is based on the Gecko 2.0 engine, which adds and improves support for HTML5 , CSS3 , WebM , and WebGL . Also, it includes
800-555: Is now endorsed by the W3C, indicating its readiness for deployment to the public, and encouraging more widespread support among implementors and authors. Recommendations can sometimes be implemented incorrectly, partially, or not at all, but many standards define two or more levels of conformance that developers must follow if they wish to label their product as W3C-compliant. A recommendation may be updated or extended by separately-published, non-technical errata or editor drafts until sufficient substantial edits accumulate for producing
850-417: Is rather static and can be delivered from web application tiers above the application, for example on load balancer or web server . In December 2015 and December 2016, a few methods of bypassing 'nonce' allowlisting origins were published. In January 2016, another method was published, which leverages server-wide CSP allowlisting to exploit old and vulnerable versions of JavaScript libraries hosted at
900-562: Is the version of a standard that has passed the prior two levels. The users of the standard provide input. At this stage, the document is submitted to the W3C Advisory Council for final approval. While this step is important, it rarely causes any significant changes to a standard as it passes to the next phase. This is the most mature stage of development. At this point, the standard has undergone extensive review and testing, under both theoretical and practical conditions. The standard
950-1002: The MIT Computer Science and Artificial Intelligence Laboratory (located in Stata Center ) in the United States, the (in Sophia Antipolis , France), Keio University (in Japan) and Beihang University (in China), the W3C incorporated as a legal entity, becoming a public-interest not-for-profit organization . The W3C has a staff team of 70–80 worldwide as of 2015 . W3C is run by a management team which allocates resources and designs strategy, led by CEO Jeffrey Jaffe (as of March 2010), former CTO of Novell . It also includes an advisory board that supports strategy and legal matters and helps resolve conflicts. The majority of standardization work
1000-789: The Massachusetts Institute of Technology (MIT) Laboratory for Computer Science with support from the European Commission , and the Defense Advanced Research Projects Agency , which had pioneered the ARPANET , the most direct predecessor to the modern Internet . It was located in Technology Square until 2004, when it moved, with the MIT Computer Science and Artificial Intelligence Laboratory, to
1050-505: The Mozilla Foundation . Before that date, 3 million people downloaded the second release candidate of the browser, which later became the final version. As a result, the new version of the browser received 10 million downloads on the first day. Notwithstanding, it fell behind the previous record established by the launch of Firefox 3 in 2008, which was 8 million. Second-day downloads for the browser were reported to be 8.75 million, but
SECTION 20
#17328945637681100-499: The Trusted Computing Base implemented by the browser; however, it has been argued to the working group by a representative of Cox Communications that this exemption is a potential security hole that could be exploited by malicious or compromised add-ons or extensions. As of 2015 a number of new browser security standards are being proposed by W3C, most of them complementary to CSP: Firefox 4 Mozilla Firefox 4
1150-400: The 10-year-old and discontinued Internet Explorer 6 for the first time. Also on that date, the browser's usage share was higher than all versions of Safari , Opera and older versions of Firefox with the exception of Firefox 3.6 . As a reference, Internet Explorer 9's usage share first exceeded that of Internet Explorer 6 on May 1, 2011 (48 days after release), and Internet Explorer 9 became
1200-597: The Firefox button menu but remain available from the Menu bar. The Menu bar can be displayed temporarily by pressing and releasing the Alt key. Selecting a Menu bar command or pressing the Alt key again dismisses the Menu bar. A prompt to save the session (tabs and windows) was presented by default in Firefox 3, with the session restored on the next start if the user selected the "Save & Quit" option. In Firefox 4, all sessions are saved. On
1250-555: The Firefox release manager wrote in an email "Firefox 5 will be the security update for Firefox 4," confirming Firefox 4 had entered its " end of life " phase where Mozilla will no longer issue updates. Mozilla continued to issue updates for Firefox 3.6 after 4's EOL declaration. Only one update (4.0.1) was issued for Firefox 4 during its lifetime. Many looking for a copy of this version 4 will be directed to version 6, which cannot run on PowerPC Macintoshes. Mozilla Firefox 4 includes many new features since version 3.6 . Firefox 4 brought
1300-471: The Stata Center. The organization tries to foster compatibility and agreement among industry members in the adoption of new standards defined by the W3C. Incompatible versions of HTML are offered by different vendors, causing inconsistency in how web pages are displayed. The consortium tries to get all those vendors to implement a set of core principles and components that are chosen by the consortium. It
1350-450: The W3C started considering adding DRM -specific Encrypted Media Extensions (EME) to HTML5 , which was criticised as being against the openness, interoperability, and vendor neutrality that distinguished websites built using only W3C standards from those requiring proprietary plug-ins like Flash . On 18 September 2017, the W3C published the EME specification as a recommendation, leading to
1400-516: The W3C. Many guidelines and requirements are stated in detail, but there is no final guideline about the process or standards by which membership might be finally approved or denied. The cost of membership is given on a sliding scale, depending on the character of the organization applying and the country in which it is located. Countries are categorized by the World Bank 's most recent grouping by gross national income per capita. In 2012 and 2013,
1450-434: The designated receiver specified in report-uri . This allows potential attackers to arbitrarily trigger those alarms and might render them less useful in case of a real attack. This behaviour is intended and cannot be fixed, as the browser (client) is sending the reports. According to the original CSP (1.0) Processing Model (2012–2013), CSP should not interfere with the operation of browser add-ons or extensions installed by
1500-628: The development of standards for the World Wide Web. As of 5 March 2023, W3C had 462 members. W3C also engages in education and outreach, develops software and serves as an open forum for discussion about the Web. The World Wide Web Consortium (W3C) was founded in 1994 by Tim Berners-Lee after he left the European Organization for Nuclear Research ( CERN ) in October 1994. It was founded at
1550-450: The experimental X-Content-Security-Policy header. A number of web application frameworks support CSP, for example AngularJS (natively) and Django (middleware). Instructions for Ruby on Rails have been posted by GitHub . Web framework support is however only required if the CSP contents somehow depend on the web application's state—such as usage of the nonce origin. Otherwise, the CSP
Content Security Policy - Misplaced Pages Continue
1600-455: The first integer in the title (e.g. CSS3 = Level 3). Subsequent revisions on each level are denoted by an integer following a decimal point (for example, CSS2.1 = Revision 1). The W3C standard formation process is defined within the W3C process document, outlining four maturity levels through which each new standard or recommendation must progress. After enough content has been gathered from 'editor drafts' and discussion, it may be published as
1650-441: The future, this privacy request may become a legal requirement. It also introduced the ability to delete flash cookies , subjecting them to the same deletion rules as ordinary HTTP cookies . Nightly builds were marked as 4.0a1pre between February and June 2008, but were renamed to 3.1a1pre afterwards. On 22 March 2011, and during the 24-hour launch period, Firefox 4 received 7.1 million downloads, as counted and verified by
1700-468: The lack of an official representative from Guinness to monitor the numbers, made the record attained by Firefox 3 only unofficially been broken. On the official launch date, the usage share for the Firefox 4 was 1.95%, which was 0.34% higher than the previous day according to analytics website StatCounter. As a comparison, the usage share for the Internet Explorer 9 on March 22 was 0.87%, and it
1750-480: The next start, the session is available from the History menu. This new feature, called on-demand session restore, overwrites the previous session on exit without prompting. The user can check whether there is a saved session at any time by viewing the History menu item "Restore Previous Session". If it is available (not greyed out) there is a restorable session available. In beta 7 introduced new config option to limit
1800-511: The number of tabs loaded at once during session restore. This also made possible to lazy load tabs, the preferences option to switch this behavior appeared in version 8. W3C The World Wide Web Consortium ( W3C ) is the main international standards organization for the World Wide Web . Founded in 1994 and led by Tim Berners-Lee , the consortium is made up of member organizations that maintain full-time staff working together in
1850-455: The plans for "Mozilla 2", referring to the most comprehensive iteration since its creation of the overall platform on which Firefox and other Mozilla products run. Most of these objectives were incorporated into versions 3.0, 3.5, and 3.6. The largest changes, however, were deferred to Firefox 4.0. In early May 2010, Mozilla's plans for Firefox 4.0 were officially detailed through a blog post by Mike Beltzner, Firefox director. On May 25, 2011,
1900-599: The release notes. The Firefox button groups the menus in Firefox 4. It is displayed by default on the Windows 7 and Windows Vista operating systems. It can be displayed on other operating systems by selecting "Toolbars" from the View menu and unchecking "Menu Bar". The Menu bar can be restored by selecting "Options" from the Firefox button menu and checking "Menu Bar". Certain menu items, such as "Page Info" and "Import" (for importing bookmarks and other browser data), are not available from
1950-507: The same server (frequent case with CDN servers). In May 2017 one more method was published to bypass CSP using web application frameworks code. If the Content-Security-Policy header is present in the server response, a compliant client enforces the declarative allowlist policy. One example goal of a policy is a stricter execution mode for JavaScript in order to prevent certain cross-site scripting attacks. In practice this means that
2000-480: The second most used version of Internet Explorer for the first time on May 22, 2011 (69 days after release). According to StatCounter, Firefox 4 reached its usage share peak of 16.7% on June 19, 2011. After that date, it started to decline due to weekly trends and the release of Firefox 5 . Firefox 4 represents a departure in user interface layout and behaviour from previous versions. Users face some issues negotiating these changes, some of which are not documented in
2050-616: The standard matures. A candidate recommendation is a version of a more mature standard than the WD. At this point, the group responsible for the standard is satisfied that the standard meets its goal. The purpose of the CR is to elicit aid from the development community on how implementable the standard is. The standard document may change further, but significant features are mostly decided at this point. The design of those features can still change due to feedback from implementors. A proposed recommendation
Content Security Policy - Misplaced Pages Continue
2100-465: The user agent, and other such mechanisms. The absolute "should" wording was being used by browser users to request/demand adherence to the policy and have changes installed in popular browsers (Firefox, Chrome, Safari) to support it. This was particularly contentious when sites like Twitter and GitHub started using strong CSP policies, which 'broke' the use of Bookmarklets. The W3C Web Application Security Working Group considers such script to be part of
2150-408: The user interface. By default, tabs were displayed on the top of the window, above the location bar in the area formerly occupied by the window's title bar . The "stop", "reload", and "go" buttons were combined into a single button, placed on the right side of the address bar. The button changed dynamically, based on the current state of the page. On Windows Vista and Windows 7 , the menu bar
2200-530: The user. This feature of CSP would have effectively allowed any add-on, extension, or Bookmarklet to inject script into web sites, regardless of the origin of that script, and thus be exempt from CSP policies. However, this policy has since been modified (as of CSP 1.1) with the following wording. Note the use of the word "may" instead of the prior absolute "should (not)" wording: Note: User agents may allow users to modify or bypass policy enforcement through user preferences, bookmarklets, third-party additions to
2250-528: The web browsers. The following header names are in use as part of experimental CSP implementations: A website can declare multiple CSP headers, also mixing enforcement and report-only ones. Each header will be processed separately by the browser. CSP can also be delivered within the HTML code using a meta tag , although in this case its effectiveness will be limited. Internet Explorer 10 and Internet Explorer 11 also support CSP, but only sandbox directive, using
2300-537: The world. As of September 2009, it had eighteen World Offices covering Australia, the Benelux countries (Belgium, Netherlands and Luxembourg), Brazil, China, Finland, Germany, Austria, Greece, Hong Kong, Hungary, India, Israel, Italy, South Korea, Morocco, South Africa, Spain, Sweden, and, as of 2016, the United Kingdom and Ireland. In October 2012, W3C convened a community of major web players and publishers to establish
2350-562: Was moving all application data into a single file, omni.jar, using a new file format based on the Java Archive format (previous versions used multiple files in the Java Archive format). For later versions the file was renamed omni.ja. Firefox 4 contains support for the "do not track" header , an emerging standard for Web privacy. The header signals the user's request to the web service that any web visitor tracking service be disabled. In
2400-556: Was one security update in April 2011 (4.0.1) and version 4 of the browser was made obsolete by the release of Firefox 5 in June 2011. This marked a transition to giving much less weight to major version numbers, with 5 more major version numbers used by December of that year (5, 6, 7, 8, and 9), compared to 4 in nearly a decade of Firefox development (1, 2, 3, 4). On October 13, 2006, Brendan Eich , Mozilla's Chief Technology Officer , wrote about
2450-685: Was originally intended that CERN host the European branch of W3C; however, CERN wished to focus on particle physics , not information technology . In April 1995, the French Institute for Research in Computer Science and Automation became the European host of W3C, with Keio University Research Institute at SFC becoming the Asian host in September 1996. Starting in 1997, W3C created regional offices around
2500-556: Was released the prior week, on March 14. A potential factor on Firefox 4's higher usage share is that the latter supports both Windows 2000 and XP , two operating systems Internet Explorer 9 does not support. Also, at launch, Mozilla prompted existing customers to upgrade their browsers to the newer version, something Microsoft hadn't applied to users of older versions of Internet Explorer. Instead, Microsoft prompted users to upgrade via Windows Update several weeks after launch. On March 26, 2011, Firefox 4's usage share exceeded that of
#767232