Skip to content

Conversation

@manuel-sommer
Copy link
Contributor

@manuel-sommer manuel-sommer commented Oct 30, 2025

grafik

@dryrunsecurity
Copy link

dryrunsecurity bot commented Oct 30, 2025

DryRun Security

🔴 Risk threshold exceeded.

This pull request modifies sensitive codepaths (notably dojo/pipeline.py and dojo/middleware.py) triggering configured-codepath alerts, and also includes broad exception logging in dojo/middleware.py that may disclose sensitive information (e.g., PII or tokens) by logging raw exception objects. Review and restrict who can edit those files via .dryrunsecurity.yaml and sanitize or redact logged exceptions to avoid information leakage.

🔴 Configured Codepaths Edit in dojo/pipeline.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
🔴 Configured Codepaths Edit in dojo/pipeline.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
🔴 Configured Codepaths Edit in dojo/middleware.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
🔴 Configured Codepaths Edit in dojo/pipeline.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
🔴 Configured Codepaths Edit in dojo/pipeline.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
Information Disclosure via Error Logging in dojo/middleware.py
Vulnerability Information Disclosure via Error Logging
Description The code logs the full string representation of any unhandled exception during social login using logger.error(f"Unhandled exception during social login: {exception}"). This practice carries a significant risk of information disclosure. Exception objects, especially those originating from authentication libraries or external identity providers, can contain sensitive data such as user PII (e.g., email addresses, full names), authentication tokens, session IDs, or internal system details (e.g., file paths, configuration values, stack traces). Logging the raw exception object without sanitization or redaction creates a risk of exposing this sensitive information in application logs, which could be accessed by unauthorized individuals or systems. While specific examples of social_core exceptions leaking PII were not found with the available tools, the general principle of secure logging dictates that such broad logging of exception details in a security-sensitive context is a vulnerability.

logger.error(f"Unhandled exception during social login: {exception}")
return super().process_exception(request, exception)

We've notified @mtesauro.


All finding details can be found in the DryRun Security Dashboard.

Copy link
Contributor

@quirinziessler quirinziessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you only want to log this as warning? Error and gracefully stopping the login process would be better imo.

@manuel-sommer
Copy link
Contributor Author

manuel-sommer commented Oct 30, 2025

Are you sure you only want to log this as warning? Error and gracefully stopping the login process would be better imo.

Thank you @quirinziessler for your review

@Maffooch
Copy link
Contributor

Would it be possible to raise this error in the UI by using the middleware introduced in your other PR? Not sure if this pipeline function would be too late in the process or not

@manuel-sommer
Copy link
Contributor Author

Ok, merge the other PR and I will check if I can add it there with rebasing this PR.

@manuel-sommer
Copy link
Contributor Author

I don't want to add an additional functionality after everyone has approved and right before it gets merged.

@manuel-sommer
Copy link
Contributor Author

Done @Maffooch, it works solid, you can review

@valentijnscholten valentijnscholten added this to the 2.52.0 milestone Oct 30, 2025
Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manuel-sommer nice work 😄

@Maffooch Maffooch requested review from Jino-T and valentijnscholten and removed request for quirinziessler October 31, 2025 18:04
Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@manuel-sommer manuel-sommer requested a review from kiblik November 3, 2025 15:02
@github-actions github-actions bot added the settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR label Nov 3, 2025
@mtesauro mtesauro merged commit 9fb0dae into DefectDojo:bugfix Nov 3, 2025
149 checks passed
@manuel-sommer manuel-sommer deleted the usernameNone branch November 3, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants