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

Tracking pull request to merge release-1.61.0 to master #2270

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

kuanfandevops
Copy link
Collaborator

No description provided.

kuanfandevops and others added 4 commits September 24, 2024 11:44
* feat: 2207 - sales forecast (#2211)

* initial commit

* small change

* sales forecast backend

* feat: 2204 and 2209 - sales forecast (#2218)

* feat: 2204 and 2209 = sales forecast

* some changes

* wording changes

* some changes

* oct 1 stuff - spreadsheet column name changes (#2225)

* address codeQL-raised issue

* Task: Frontend Spreadsheet Record Validation #2220 (#2228)

* Frontend validation for SalesForecastRecord records.

* Fixing casing

* Cleanup

* feat: 2219 - forecast report column mapping + automatic summation of ZEVs supplied (#2231)

* feat: 2219 - forecast report colum mapping + automatic summation of ZEVs supplied

* small change

* fix totals display upon discard of records

* feat: 2221 - some styling (#2236)

* Task: Sales Forecast Report Checkbox Assertion #2222 (#2232)

* Adding new signing authority assertion for Sales Forecast

* Cleaning up

* wording changes

* formatting

* fix: amend download() function to take into account case where content-disposition is not an exposed header

* update template

* spreadsheet validation updates

* spreadsheet validation cleanup

* Added message for a successful or unsuccessful upload (#2278)

Co-authored-by: julianforeman <julianforeman@me.com>

* cleanup

---------

Co-authored-by: JulianForeman <71847719+JulianForeman@users.noreply.github.com>
Co-authored-by: julianforeman <julianforeman@me.com>
history.push(ROUTES_COMPLIANCE.REPORTS)
history.replace(
ROUTES_COMPLIANCE.REPORT_CONSUMER_SALES.replace(':id', id)
ROUTES_COMPLIANCE.REPORT_CONSUMER_SALES.replace(/:id/g, id)

Check failure

Code scanning / CodeQL

Client-side cross-site scripting High

Cross-site scripting vulnerability due to
user-provided value
.

Copilot Autofix AI about 1 month ago

To fix the problem, we need to sanitize the id parameter before using it in the URL. This can be done by ensuring that the id parameter only contains safe characters. A common approach is to use a library like DOMPurify to sanitize the input or to use a regular expression to allow only alphanumeric characters.

In this case, we will use a regular expression to allow only alphanumeric characters in the id parameter. This will prevent any malicious scripts from being included in the URL.

Suggested changeset 1
frontend/src/compliance/ConsumerSalesContainer.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/compliance/ConsumerSalesContainer.js b/frontend/src/compliance/ConsumerSalesContainer.js
--- a/frontend/src/compliance/ConsumerSalesContainer.js
+++ b/frontend/src/compliance/ConsumerSalesContainer.js
@@ -30,3 +30,4 @@
   const [forecastTotals, setForecastTotals] = useState({})
-  const { id } = useParams()
+  const { id: rawId } = useParams()
+  const id = rawId.replace(/[^a-zA-Z0-9]/g, '')
 
EOF
@@ -30,3 +30,4 @@
const [forecastTotals, setForecastTotals] = useState({})
const { id } = useParams()
const { id: rawId } = useParams()
const id = rawId.replace(/[^a-zA-Z0-9]/g, '')

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
* fix: adds context to update comment

* chore: removes extra spaces
Copy link

sonarcloud bot commented Sep 27, 2024

@kuanfandevops kuanfandevops merged commit 73c61fa into master Oct 1, 2024
11 of 13 checks passed
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.

3 participants