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

Oct 1 2024 stuff -- build-on-dev #2226

Merged
merged 16 commits into from
Sep 27, 2024
Merged

Conversation

tim738745
Copy link
Collaborator

No description provided.

@tim738745 tim738745 marked this pull request as draft August 21, 2024 21:57
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
@tim738745 tim738745 changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 9, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff - Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff - build-on-dev Sep 10, 2024
@tim738745 tim738745 changed the title Oct 1 2024 stuff - build-on-dev Oct 1 2024 stuff -- build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff -- build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff -- build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff -- build-on-dev Oct 1 2024 stuff Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff -- build-on-dev Sep 10, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff -- build-on-dev Oct 1 2024 stuff Sep 17, 2024
@kuanfandevops kuanfandevops changed the title Oct 1 2024 stuff Oct 1 2024 stuff -- build-on-dev Sep 17, 2024
tim738745 and others added 4 commits September 25, 2024 13:30
* initial commit

* small change

* sales forecast backend
* feat: 2204 and 2209 = sales forecast

* some changes

* wording changes

* some changes
JulianForeman and others added 10 commits September 25, 2024 13:30
* Frontend validation for SalesForecastRecord records.

* Fixing casing

* Cleanup
…ZEVs supplied (#2231)

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

* small change

* fix totals display upon discard of records
* Adding new signing authority assertion for Sales Forecast

* Cleaning up
@tim738745 tim738745 changed the base branch from release-1.60.0 to release-1.61.0 September 25, 2024 20:33
@tim738745 tim738745 marked this pull request as ready for review September 25, 2024 20:54
tim738745 and others added 2 commits September 27, 2024 11:33
Co-authored-by: julianforeman <julianforeman@me.com>
Copy link

sonarcloud bot commented Sep 27, 2024

@tim738745 tim738745 merged commit 80512e9 into release-1.61.0 Sep 27, 2024
1 of 2 checks passed
kuanfandevops added a commit that referenced this pull request Oct 1, 2024
* initial update for 1.61.0

* udpate pr number

* fix - adds is_government to basic user serializer (#2276)

* Oct 1 2024 stuff  -- build-on-dev (#2226)

* 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>

* fix: comment edit (#2277)

* fix: adds context to update comment

* chore: removes extra spaces

---------

Co-authored-by: Emily <44536222+emi-hi@users.noreply.github.com>
Co-authored-by: tim738745 <98717409+tim738745@users.noreply.github.com>
Co-authored-by: JulianForeman <71847719+JulianForeman@users.noreply.github.com>
Co-authored-by: julianforeman <julianforeman@me.com>
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