Skip to content

Error-handling and Logging #29

Description

@PACHAKUTlQ

Refactor backend to add logging and error handling following modern best practice, for better code quality, observability and security.
The new error handling should take care of all known and unknown issues, log and return error for known issues, and log with stack trace for unknown issues.
The log injection vulnerabilities reported by CodeQL in #27 is NOT completely fixed, there are other points where user-controlled data flow into log. These must be fixed with the refactor using something like:

logging.error("action: %s", action)  # New line characters auto escaped

instead of:

logging.error(f"action: {action}")

and potentially sanitize it to prevent XSS when viewing log (Defense-in-depth, but may break things. Pending discussion).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions