Vulnerabilities

17 via 26 paths

Dependencies

35

Source

GitHub

Commit

9264db65

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 17
  • 6
Severity
  • 5
  • 16
  • 2
Status
  • 23
  • 0
  • 0

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: pylint
  • Introduced through: pylint@2.6.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 pylint@2.6.0
    Remediation: Upgrade to pylint@2.6.1.

Overview

pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). A regular expression denial of service issue exists in pyreverse. The ambiguities of vulnerable regular expressions are removed, making the repaired regular expressions safer and faster matching.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade pylint to version 2.6.1 or higher.

References

high severity

GPL-3.0 license

  • Module: ansible
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0

GPL-3.0 license

high severity

GPL-3.0 license

  • Module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12

GPL-3.0 license

high severity

GPL-2.0 license

  • Module: pylint
  • Introduced through: pylint@2.6.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 pylint@2.6.0

GPL-2.0 license

high severity

GPL-3.0 license

  • Module: yamllint
  • Introduced through: yamllint@1.19.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 yamllint@1.19.0

GPL-3.0 license

medium severity

Exposure of Sensitive Information in Log Files

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Exposure of Sensitive Information in Log Files when loading variables from Ansible Vault without setting no_log: true, which is the behavior of some tasks, including include_vars. This vulnerability can be exploited during the execution of a playbook.

Note:

This is a similar vulnerability to the previously reported CVE-2024-0690.

Remediation

Upgrade ansible-core to version 2.14.18rc1 or higher.

References

medium severity

Improper Control of Generation of Code ('Code Injection')

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Improper Control of Generation of Code ('Code Injection'). An attacker can inject malicious code into the template, leading to unauthorized access and potential data compromise.

Remediation

Upgrade ansible-core to version 2.15.7rc1, 2.16.1rc1 or higher.

References

medium severity

Symlink Attack

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Symlink Attack via the ansible-galaxy function. When installing a maliciously created Ansible role using ansible-galaxy role install, arbitrary files the user has access to can be overwritten. The malicious role must contain a symlink with an absolute path to the target file, followed by a file of the same name (as the symlink) with the contents to write to the target.

Remediation

Upgrade ansible-core to version 2.13.13rc1, 2.14.11rc1, 2.15.5rc1, 2.16.0b2 or higher.

References

medium severity

Open Redirect

  • Vulnerable module: urllib3
  • Introduced through: botocore@1.23.1, awscli@1.22.1 and others

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 botocore@1.23.1 urllib3@1.26.20
    Remediation: Upgrade to botocore@1.34.67.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 awscli@1.22.1 botocore@1.23.1 urllib3@1.26.20
    Remediation: Upgrade to awscli@1.32.67.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 boto3@1.20.0 botocore@1.23.1 urllib3@1.26.20
    Remediation: Upgrade to boto3@1.34.67.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 awscli@1.22.1 s3transfer@0.5.2 botocore@1.23.1 urllib3@1.26.20
    Remediation: Upgrade to awscli@1.32.67.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 boto3@1.20.0 s3transfer@0.5.2 botocore@1.23.1 urllib3@1.26.20
    Remediation: Upgrade to boto3@1.34.67.

Overview

urllib3 is a HTTP library with thread-safe connection pooling, file post, and more.

Affected versions of this package are vulnerable to Open Redirect due to the retries parameter being ignored during PoolManager instantiation. An attacker can access unintended resources or endpoints by leveraging automatic redirects when the application expects redirects to be disabled at the connection pool level.

Note:

requests and botocore users are not affected.

Workaround

This can be mitigated by disabling redirects at the request() level instead of the PoolManager() level.

Remediation

Upgrade urllib3 to version 2.5.0 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: jinja2
  • Introduced through: jinja2@2.11.3 and ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 jinja2@2.11.3
    Remediation: Upgrade to jinja2@3.1.3.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12 jinja2@2.11.3
    Remediation: Upgrade to ansible@4.8.0.

Overview

Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the xmlattr filter, when using keys containing spaces in an application accepts keys as user input. An attacker can inject arbitrary HTML attributes into the rendered HTML template, bypassing the auto-escaping mechanism, which may lead to the execution of untrusted scripts in the context of the user's browser session.

Note Accepting keys as user input is not common or a particularly intended use case of the xmlattr filter, and an application doing so should already be verifying what keys are provided regardless of this fix.

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade Jinja2 to version 3.1.3 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: jinja2
  • Introduced through: jinja2@2.11.3 and ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 jinja2@2.11.3
    Remediation: Upgrade to jinja2@3.1.4.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12 jinja2@2.11.3
    Remediation: Upgrade to ansible@4.8.0.

Overview

Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) through the xmlattr filter. An attacker can manipulate the output of web pages by injecting additional attributes into elements, potentially leading to unauthorized actions or information disclosure.

Note: This vulnerability derives from an improper fix of CVE-2024-22195, which only addressed spaces but not other characters.

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade Jinja2 to version 3.1.4 or higher.

References

medium severity

Improper Neutralization

  • Vulnerable module: jinja2
  • Introduced through: jinja2@2.11.3 and ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 jinja2@2.11.3
    Remediation: Upgrade to jinja2@3.1.5.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12 jinja2@2.11.3
    Remediation: Upgrade to ansible@4.8.0.

Overview

Affected versions of this package are vulnerable to Improper Neutralization when importing a macro in a template whose filename is also a template. This will result in a SyntaxError: f-string: invalid syntax error message because the filename is not properly escaped, indicating that it is being treated as a format string.

Note: This is only exploitable when the attacker controls both the content and filename of a template and the application executes untrusted templates.

Remediation

Upgrade jinja2 to version 3.1.5 or higher.

References

medium severity

Template Injection

  • Vulnerable module: jinja2
  • Introduced through: jinja2@2.11.3 and ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 jinja2@2.11.3
    Remediation: Upgrade to jinja2@3.1.5.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12 jinja2@2.11.3
    Remediation: Upgrade to ansible@4.8.0.

Overview

Affected versions of this package are vulnerable to Template Injection when an attacker controls the content of a template. This is due to an oversight in the sandboxed environment's method detection when using a stored reference to a malicious string's format method, which can then be executed through a filter.

Note: This is only exploitable through custom filters in an application.

Remediation

Upgrade jinja2 to version 3.1.5 or higher.

References

medium severity

Template Injection

  • Vulnerable module: jinja2
  • Introduced through: jinja2@2.11.3 and ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 jinja2@2.11.3
    Remediation: Upgrade to jinja2@3.1.6.
  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12 jinja2@2.11.3
    Remediation: Upgrade to ansible@4.8.0.

Overview

Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.

Affected versions of this package are vulnerable to Template Injection through the |attr filter. An attacker that controls the content of a template can escape the sandbox and execute arbitrary Python code by using the |attr filter to get a reference to a string's plain format method, bypassing the environment's attribute lookup.

Note:

This is only exploitable if the application executes untrusted templates.

Remediation

Upgrade Jinja2 to version 3.1.6 or higher.

References

medium severity

Incorrect Authorization

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Incorrect Authorization through the user module. An attacker can modify or replace file contents and take ownership of files on any system path by exploiting directory traversal permissions.

Note:

This is only exploitable if someone with root privileges uses the user module with the generate_ssh_key option (disabled by default) and targets an unprivileged user. The unprivileged user needs to have traversal permissions on the directory containing the exploited target file.

Remediation

Upgrade ansible-core to version 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: pylint
  • Introduced through: pylint@2.6.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 pylint@2.6.0
    Remediation: Upgrade to pylint@2.7.0.

Overview

pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the SPECIAL and PRIVATE attributes in pylint/pylint/pyreverse/utils.py. The ReDoS is mainly due to the pattern [^\W_]+\w*, and can be exploited with an input string such as "__"+"1"*5000 + "!".

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade pylint to version 2.7.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: pylint
  • Introduced through: pylint@2.6.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 pylint@2.6.0
    Remediation: Upgrade to pylint@2.6.1.

Overview

pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to issues in its pyreverse component. This issue arises from certain regular expressions in pyreverse that can be exploited by causing catastrophic backtracking, significantly slowing down the service by forcing it to take a disproportionate amount of time to process inputs. This vulnerability allows attackers to use specially crafted inputs that increase the processing time exponentially, potentially leading to a service becoming inaccessible to legitimate users.

PoC

"__"+"1"*5000 + "!"

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade pylint to version 2.6.1 or higher.

References

medium severity

Improper Output Neutralization for Logs

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Improper Output Neutralization for Logs due to a failure to respect the ANSIBLE_NO_LOG configuration in some scenarios. This could allow an attacker to obtain sensitive information, such as decrypted secret values from the output of certain tasks, like loop items.

Remediation

Upgrade ansible-core to version 2.14.14, 2.15.9, 2.16.3 or higher.

References

medium severity

Credential Exposure

  • Vulnerable module: ansible
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0
    Remediation: Upgrade to ansible@7.0.0.

Overview

ansible is a simple IT automation system.

Affected versions of this package are vulnerable to Credential Exposure in amazon.aws.ec2_instance, which leaks passwords into logs when tower_callback.windows is set. This was resolved in version 5.1.0 of the amazon.aws.ec2_instance module. Note: You're only vulnerable if you're using the amazon.aws collection

Remediation

Upgrade ansible to version 7.0.0 or higher.

References

medium severity

LGPL-2.1 license

  • Module: astroid
  • Introduced through: pylint@2.6.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 pylint@2.6.0 astroid@2.5

LGPL-2.1 license

medium severity

MPL-2.0 license

  • Module: pathspec
  • Introduced through: yamllint@1.19.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 yamllint@1.19.0 pathspec@0.11.2

MPL-2.0 license

low severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: awscli
  • Introduced through: awscli@1.22.1

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 awscli@1.22.1
    Remediation: Upgrade to awscli@1.27.90.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when an attacker can craft a malicious nuget.config file. This vulnerability can be exploited when a user performs Nuget or Dotnet login

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade awscli to version 1.27.90 or higher.

References

low severity

Improper Input Validation

  • Vulnerable module: ansible-core
  • Introduced through: ansible@4.8.0

Detailed paths

  • Introduced through: shinesolutions/aem-aws-stack-builder@shinesolutions/aem-aws-stack-builder#9264db65c40766a8931b0c077df827791b863712 ansible@4.8.0 ansible-core@2.11.12
    Remediation: Upgrade to ansible@4.8.0.

Overview

ansible-core is an a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.

Affected versions of this package are vulnerable to Improper Input Validation through the use of the hostvars object. Attackers can bypass unsafe content protections and execute templated content, leading to arbitrary code execution. This is only exploitable if attackers can modify the content returned to a play that utilizes hostvars to reference unsafe content

Workaround

Restrict access to inventory files and Ansible playbooks to trusted users to minimize exploitation risks and avoid using the hostvars object to reference content marked as !unsafe.

Remediation

Upgrade ansible-core to version 2.16.9, 2.17.2 or higher.

References