Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request from patched fixes 8 issues.
Fixed potential XSS vulnerability
ReplacedinnerHTML
withtextContent
to securely encode user-controlled data and prevent potential XSS attacks.Fix unsafe console.log string concatenation vulnerability
Replace dynamic string concatenation in console.log with a template string to prevent potential log forging.Fixed potential log forgery through non-literal variable in console.log function
Changed the console log which was vulnerable to forgery due to usage of non-literal variable. Now, the JSON object intended to be logged is stringified and passed as a constant value.Prevent potential misuse of console.log by hardcoding the log message format.
The change includes the removal of the variable string (produced by JSON.stringify) directly passed into console.log which makes the code susceptible to string formatting exploits. Instead, a template literal indicating the purpose of the string has been specified as a constant string and%o
is inserted to represent the stringified objectl
.Fixed potential ReDoS vulnerability in RegExp variable constructor
Changed dynamically generated RegExp pattern into a hardcoded, safer regexp pattern to avoid potential Regular Expression Denial-of-Service (ReDoS) vulnerability.Address security vulnerabilities in the 'redis' service configuration
Enhanced the 'redis' service configuration by setting 'no-new-privileges' to true in 'security_opt' and 'read_only' to true. These changes prevent privilege escalation and do not allow root filesystem to be writable.Fix potential SQL injection vulnerability
Changed the SQL query format in the create method to use parameterized queries instead of formatted string, to prevent potential SQL injection attacks.Replace insecure md5 hashing with secure scrypt password hashing
Replaced the hashlib.md5 function with the hashlib.scrypt function in the 'check_password' method of the User class.