Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #599 from cisagov/CD-command-injection-fixes
Browse files Browse the repository at this point in the history
Update fixes for command injections at bulletin_generator
  • Loading branch information
cduhn17 committed Jul 14, 2023
2 parents bb77b5e + 94059ce commit 818ecce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/pe_reports/helpers/bulletin/bulletin_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Standard Python Libraries
import datetime
import html
import logging
import os

Expand Down Expand Up @@ -50,6 +51,7 @@ def html_builder(text):
if input_type == "P":
LOGGER.info("Paragraph Selected")
paragraph = input("Please enter paragraph text:")
paragraph = html.escape(paragraph)
paragraph = f"<p> {paragraph} </p>"
text = text + f"\n {paragraph}"

Expand All @@ -58,6 +60,7 @@ def html_builder(text):
bullets = "<ul>\n"
while True:
item = input("Enter line item: ")
item = html.escape(item)
if item == "D":
bullets = bullets + "</ul>"
break
Expand All @@ -69,6 +72,7 @@ def html_builder(text):
bullets = "<ol>\n"
while True:
item = input("Enter line item: ")
item = html.escape(item)
if item == "D":
bullets = bullets + "</ol>"
break
Expand All @@ -78,6 +82,7 @@ def html_builder(text):
LOGGER.info("Invalid Selection")

cont = input("Would you like to add more content (Y/N): ")
cont = html.escape(cont)
if cont == "Y":
text = html_builder(text)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
</div>
</div>

<div id="loading" class="justify-content-lg-center"></div>
<div class="row justify-content-lg-center">
<div class="row col-lg-6 offset-lg-3">
<input type="hidden" value="{% block title %} Stakeholder {% endblock %}" />
Expand Down
3 changes: 0 additions & 3 deletions src/pe_reports/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ body {
background-color: #324ca8;
}

.htmx-settling img {
opacity: 0;
}
img {
transition: opacity 300ms ease-in;
}
Expand Down
1 change: 0 additions & 1 deletion src/pe_reports/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
crossorigin="anonymous"
></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="../static/js/htmx.js"></script>

<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
Expand Down

0 comments on commit 818ecce

Please sign in to comment.