Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoing: Using Jinja2 templates #254

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

exeba
Copy link
Contributor

@exeba exeba commented Jul 4, 2022

I've been doing a bit of refactoring to make the code clearer to me.
If you think this is helpful here is my pull request.

env = jinja2.Environment(
loader = jinja2.FileSystemLoader('./templates'),
extensions = ["jinja2_humanize_extension.HumanizeExtension"]
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opt.semgrep.python.jinja2.security.audit.autoescape-disabled.autoescape-disabled: Detected a Jinja2 environment without autoescaping. Jinja2 does not autoescape by default.
This is dangerous if you are rendering to a browser because this allows for cross-site
scripting (XSS) attacks. If you are in a web context, enable autoescaping by setting
autoescape=True.

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -2,3 +2,5 @@ geoip2==4.5.0
humanize==3.13.1
bottle==0.12.19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical OSS Vulnerability:

pkg:pypi/bottle@0.12.19

1 Critical, 2 Severe, 0 Moderate, 0 Unknown vulnerabilities have been found across 1 dependencies

Components
    pkg:pypi/bottle@0.12.19
      CRITICAL Vulnerabilities (1)

        [CVE-2022-31799] CWE-755: Improper Handling of Exceptional Conditions

        Bottle before 0.12.20 mishandles errors during early request binding.

        CVSS Score: 9.8

        CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

        CWE: CWE-755

      SEVERE Vulnerabilities (2)
        sonatype-2019-0663

        [sonatype-2019-0663] CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustion')

        Bottle - Regular expression Denial of Service (ReDoS) vulnerability

        The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.

        CVSS Score: 5.3

        CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

        CWE: CWE-400

        sonatype-2020-0020

        [sonatype-2020-0020] CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustion')

        bottle - Regular Expression Denial of Service (ReDoS)

        The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.

        CVSS Score: 5.3

        CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

        CWE: CWE-400

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant