-
Notifications
You must be signed in to change notification settings - Fork 14
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.65.0 to master #2358
Conversation
…re isnt an empty box when agreements dont have comments (#2359) chore: modifies proptypes in vehicle supplier tabs due to console messages appearing
* Create unit-tests for ComplianceObligationContainer * Refactor ComplianceObligationContainer for unit-test edge case * Grouping some tests * Refactor compliance unit-tests to reduce duplicated codes * Refactor TestHelper class to TestData class * Grouping common test data * Refactor testData class in ComplianceObligationContainer test
* Add unit-tests for Compliance and Compliance-components * Minor clean-up * Minor clean-up
…caught reference error) (#2378)
…event Error 31 (duplicate VINs) (#2370) * task: spreadsheets with duplicate vins are rejected with error message during submission * chore: moves line out of loop
* unit tests for supp components * tweaks and start zevsales * get rid of duplication
#2377) * -adds navigation tabs to credit agreement details * chore: ran prettier
* Disable Save button if vehicle supplier, transaction type, or effective date is not entered. * Disable "Submit to Director" button if credit quantity is missing.
* Add model-year in query string to solve tab-names inconsistency during loading issue. * Add URI encoding and code clean-up * Align compliance report tabs * Fixing compliance report disabled tabs alignment * Disable compliance-report tabs when loading. * Move insertIdAndYear function to utilities
const getRoute = () => { | ||
if (locationRoute && locationState) { | ||
return history.push(locationRoute, locationState) | ||
return history.push(locationRoute, locationState); |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that the locationRoute
parameter is properly sanitized before being used in the history.push
method. One effective way to do this is by using a library like DOMPurify
to sanitize the user input. This will prevent any malicious scripts from being executed.
- Install the
DOMPurify
library. - Import
DOMPurify
in the relevant files. - Sanitize the
locationRoute
parameter before using it in thehistory.push
method.
-
Copy modified line R6 -
Copy modified lines R22-R24 -
Copy modified lines R27-R28
@@ -5,2 +5,3 @@ | ||
import history from "../History"; | ||
import DOMPurify from "dompurify"; | ||
|
||
@@ -20,8 +21,9 @@ | ||
const getRoute = () => { | ||
if (locationRoute && locationState) { | ||
return history.push(locationRoute, locationState); | ||
const sanitizedRoute = DOMPurify.sanitize(locationRoute); | ||
if (sanitizedRoute && locationState) { | ||
return history.push(sanitizedRoute, locationState); | ||
} | ||
|
||
if (locationRoute) { | ||
return history.push(locationRoute); | ||
if (sanitizedRoute) { | ||
return history.push(sanitizedRoute); | ||
} |
-
Copy modified lines R53-R54
@@ -52,3 +52,4 @@ | ||
"winston": "^3.2.1", | ||
"xlsx": "^0.18.5" | ||
"xlsx": "^0.18.5", | ||
"dompurify": "^3.2.3" | ||
}, |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
} | ||
|
||
if (locationRoute) { | ||
return history.push(locationRoute) | ||
return history.push(locationRoute); |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that the locationRoute
parameter is sanitized or validated before being used in the history.push
function. One effective way to do this is to use a whitelist of allowed routes and ensure that the locationRoute
matches one of these allowed routes before proceeding.
- Create a whitelist of allowed routes.
- Validate the
locationRoute
against this whitelist before using it in thehistory.push
function. - If the
locationRoute
is not valid, handle the error appropriately (e.g., redirect to a default safe route or show an error message).
-
Copy modified line R20 -
Copy modified lines R22-R25
@@ -19,11 +19,10 @@ | ||
} = props; | ||
const allowedRoutes = ["/route1", "/route2", "/route3"]; // Add all allowed routes here | ||
const getRoute = () => { | ||
if (locationRoute && locationState) { | ||
return history.push(locationRoute, locationState); | ||
} | ||
|
||
if (locationRoute) { | ||
if (locationRoute && allowedRoutes.includes(locationRoute)) { | ||
if (locationState) { | ||
return history.push(locationRoute, locationState); | ||
} | ||
return history.push(locationRoute); | ||
} | ||
|
||
return history.goBack(); |
if (newState === 'SUBMITTED') { | ||
history.replace(ROUTES_VEHICLES.DETAILS.replace(/:id/gi, id)) | ||
if (newState === "SUBMITTED") { | ||
history.replace(ROUTES_VEHICLES.DETAILS.replace(/:id/gi, id)); |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that the id
parameter is properly sanitized before being used in constructing the URL. One way to achieve this is by using a library like DOMPurify
to sanitize the id
parameter. This will help prevent any malicious scripts from being executed.
- Install the
DOMPurify
library. - Import
DOMPurify
in the file. - Sanitize the
id
parameter before using it in the URL construction.
-
Copy modified line R14 -
Copy modified lines R22-R23
@@ -13,2 +13,3 @@ | ||
import VehicleDetailsPage from "./components/VehicleDetailsPage"; | ||
import DOMPurify from "dompurify"; | ||
|
||
@@ -20,3 +21,4 @@ | ||
}); | ||
const { id } = useParams(); | ||
const { id: rawId } = useParams(); | ||
const id = DOMPurify.sanitize(rawId); | ||
const { keycloak, user, location } = props; |
-
Copy modified lines R53-R54
@@ -52,3 +52,4 @@ | ||
"winston": "^3.2.1", | ||
"xlsx": "^0.18.5" | ||
"xlsx": "^0.18.5", | ||
"dompurify": "^3.2.3" | ||
}, |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
…tip (#2414) * feat: disables save button if forecast isn't filled, adds tooltip * fix: adds check for model year before disabling save * chore: adds proptypes
* fix: conditionally displays confirmation for sales forecast if year >= 2023 * chore: adds proptypes * chore: replaces if-then-else flow as requested by sonarcloud
* enhance ux on file upload * allow for prescence of confirm modal to be controlled via props for FileDropArea
* Create unit-tests for Credits * Grouping common test data
* unit tests for credit agreement components * reduce duplicate code
* feat: 2412 - updated sales and supplied table * small change
* feat: adds tooltip component and implements it on supplier info page and compliance obligation * chore: linting * chore: more linting * fix: adds # to css color
* fix: adds filter to credit agreement comments for bceid users * adds check to ensure comment exists for update * chore: credit agreement tests * chore: linting
* Disable Recommend buttons in credit transfer if no comment is entered. * Fix props-validation * Disable "Add Comment" button until a comment is entered. * Fix the issue that some buttons won't change back to disabled if comment is erased.
* Add admin command reset_database * minor change * Add migration and check for production environment
* credit transfer tests * more debug * ensure users get distinct organizations * remove transaction.oncommit
|
No description provided.