Skip to content

Commit

Permalink
Update alert pages
Browse files Browse the repository at this point in the history
Signed-off-by: zapbot <12745184+zapbot@users.noreply.github.com>
  • Loading branch information
zapbot committed Jul 21, 2023
1 parent dfc0e13 commit 200bb11
Show file tree
Hide file tree
Showing 10 changed files with 197 additions and 28 deletions.
30 changes: 2 additions & 28 deletions site/content/docs/alerts/43.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,7 @@ alertcount: 1
status: beta
type: alert
risk: High
solution: "Assume all input is malicious. Use an 'accept known good' input validation strategy, i.e., use an allow list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. Do not rely exclusively on looking for malicious or malformed inputs (i.e., do not rely on a deny list). However, deny lists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, 'boat' may be syntactically valid because it only contains alphanumeric characters, but it is not valid if you are expecting colors such as 'red' or 'blue.'
For filenames, use stringent allow lists that limit the character set to be used. If feasible, only allow a single '.' character in the filename to avoid weaknesses, and exclude directory separators such as '/'. Use an allow list of allowable file extensions.
Warning: if you attempt to cleanse your data, then do so that the end result is not in the form that can be dangerous. A sanitizing mechanism can remove characters such as '.' and ';' which may be required for some exploits. An attacker can try to fool the sanitizing mechanism into 'cleaning' data into a dangerous form. Suppose the attacker injects a '.' inside a filename (e.g. 'sensi.tiveFile') and the sanitizing mechanism removes the character resulting in the valid filename, 'sensitiveFile'. If the input data are now assumed to be safe, then the file may be compromised.
Inputs should be decoded and canonicalized to the application's current internal representation before being validated. Make sure that your application does not decode the same input twice. Such errors could be used to bypass allow list schemes by introducing dangerous inputs after they have been checked.
Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes '..' sequences and symbolic links.
Run your code using the lowest privileges that are required to accomplish the necessary tasks. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
Run your code in a 'jail' or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by your software.
OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows you to specify restrictions on file operations.
This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise."
solution: "Ensure that arbitrary files specified by the user are not included in the output"
references:
- http://projects.webappsec.org/Path-Traversal
- http://cwe.mitre.org/data/definitions/22.html
Expand All @@ -39,10 +19,4 @@ alerttags:
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/ascanrulesBeta/src/main/java/org/zaproxy/zap/extension/ascanrulesBeta/SourceCodeDisclosureFileInclusionScanRule.java
linktext: "org/zaproxy/zap/extension/ascanrulesBeta/SourceCodeDisclosureFileInclusionScanRule.java"
---
The Path Traversal attack technique allows an attacker access to files, directories, and commands that potentially reside outside the web document root directory. An attacker may manipulate a URL in such a way that the web site will execute or reveal the contents of arbitrary files anywhere on the web server. Any device that exposes an HTTP-based interface is potentially vulnerable to Path Traversal.

Most web sites restrict user access to a specific portion of the file-system, typically called the "web document root" or "CGI root" directory. These directories contain the files intended for user access and the executable necessary to drive web application functionality. To access files or execute commands anywhere on the file-system, Path Traversal attacks will utilize the ability of special-characters sequences.

The most basic Path Traversal attack uses the "../" special-character sequence to alter the resource location requested in the URL. Although most popular web servers will prevent this technique from escaping the web document root, alternate encodings of the "../" sequence may help bypass the security filters. These method variations include valid and invalid Unicode-encoding ("..%u2216" or "..%c0%af") of the forward slash character, backslash characters ("..\") on Windows-based servers, URL encoded characters "%2e%2e%2f"), and double URL encoding ("..%255c") of the backslash character.

Even if the web server properly restricts Path Traversal attempts in the URL path, a web application itself may still be vulnerable due to improper handling of user-supplied input. This is a common problem of web applications that use template mechanisms or load static text from files. In variations of the attack, the original URL parameter value is substituted with the file name of one of the web application's dynamic scripts. Consequently, the results can reveal source code because the file is interpreted as text instead of an executable script. These techniques often employ additional special characters such as the dot (".") to reveal the listing of the current working directory, or "%00" NULL characters in order to bypass rudimentary file extension checks.
The source code for the current page was disclosed by the web server
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Site Header is Missing"
alertid: 90005-1
alertindex: 9000501
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Ensure that Sec-Fetch-Site header is included in request headers."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies the relationship between request initiator's origin and target's origin.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Mode Header is Missing"
alertid: 90005-2
alertindex: 9000502
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Ensure that Sec-Fetch-Mode header is included in request headers."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Mode
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Allows to differentiate between requests for navigating between HTML pages and requests for loading resources like images, audio etc.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Dest Header is Missing"
alertid: 90005-3
alertindex: 9000503
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Ensure that Sec-Fetch-Dest header is included in request headers."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Dest
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies how and where the data would be used. For instance, if the value is audio, then the requested resource must be audio data and not any other type of resource.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-User Header is Missing"
alertid: 90005-4
alertindex: 9000504
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Ensure that Sec-Fetch-User header is included in user initiated requests."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-User
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies if a navigation request was initiated by a user.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Site Header Has an Invalid Value"
alertid: 90005-5
alertindex: 9000505
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Sec-Fetch-Site header must have one of the following values: same-origin, same-site, cross-origin, or none."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies the relationship between request initiator's origin and target's origin.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Mode Header Has an Invalid Value"
alertid: 90005-6
alertindex: 9000506
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Sec-Fetch-Mode header must have one of the following values: cors, no-cors, navigate, same-origin, or websocket."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Mode
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Allows to differentiate between requests for navigating between HTML pages and requests for loading resources like images, audio etc.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-Dest Header Has an Invalid Value"
alertid: 90005-7
alertindex: 9000507
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Sec-Fetch-Dest header must have one of the following values: audio, audioworklet, document, embed, empty, font, frame, iframe, image, manifest, object, paintworklet, report, script, serviceworker, sharedworker, style, track, video, worker, xslt."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Dest
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies how and where the data would be used. For instance, if the value is audio, then the requested resource must be audio data and not any other type of resource.
20 changes: 20 additions & 0 deletions site/content/docs/alerts/90005-8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Sec-Fetch-User Header Has an Invalid Value"
alertid: 90005-8
alertindex: 9000508
alerttype: "Passive"
alertcount: 8
status: alpha
type: alert
risk: Informational
solution: "Sec-Fetch-User header must have the value set to ?1."
references:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-User
cwe: 352
wasc: 9
alerttags:
- WSTG-v42-SESS-05
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---
Specifies if a navigation request was initiated by a user.
35 changes: 35 additions & 0 deletions site/content/docs/alerts/90005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "Fetch Metadata Request Headers"
alertid: 90005
alertindex: 9000500
alerttype: "Passive"
status: alpha
type: alertset
alerts:
90005-1:
alertid: 90005-1
name: "Sec-Fetch-Site Header is Missing"
90005-2:
alertid: 90005-2
name: "Sec-Fetch-Mode Header is Missing"
90005-3:
alertid: 90005-3
name: "Sec-Fetch-Dest Header is Missing"
90005-4:
alertid: 90005-4
name: "Sec-Fetch-User Header is Missing"
90005-5:
alertid: 90005-5
name: "Sec-Fetch-Site Header Has an Invalid Value"
90005-6:
alertid: 90005-6
name: "Sec-Fetch-Mode Header Has an Invalid Value"
90005-7:
alertid: 90005-7
name: "Sec-Fetch-Dest Header Has an Invalid Value"
90005-8:
alertid: 90005-8
name: "Sec-Fetch-User Header Has an Invalid Value"
code: https://github.com/zaproxy/zap-extensions/blob/main/addOns/pscanrulesAlpha/src/main/java/org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java
linktext: "org/zaproxy/zap/extension/pscanrulesAlpha/FetchMetadataRequestHeadersScanRule.java"
---

0 comments on commit 200bb11

Please sign in to comment.