Fix for Insecure Temporary File Creation#68
Merged
flemming-n-larsen merged 2 commits intorobo-code:mainfrom May 13, 2025
Merged
Fix for Insecure Temporary File Creation#68flemming-n-larsen merged 2 commits intorobo-code:mainfrom
flemming-n-larsen merged 2 commits intorobo-code:mainfrom
Conversation
The current implementation of createTempFile() has a security vulnerability related to privilege management. File operations should run with controlled privileges using Java's AccessController.doPrivileged() pattern to prevent security manager bypass or privilege escalation. This vulnerability was identified in eclipse-ee4j/jersey@5794b7a and fixed. References: 1. eclipse-ee4j/jersey@5794b7a 2. https://nvd.nist.gov/vuln/detail/cve-2022-21540
Member
|
Thank you for both identifying the vulnerability in Robocode, and also provide a PR for fixing it. ❤️ I will study the CVE and fix, and probably merge the PR as-is, unless it needs some extra consideration. |
…, and improvements to fix for createTempFile()
flemming-n-larsen
approved these changes
May 13, 2025
Member
flemming-n-larsen
left a comment
There was a problem hiding this comment.
The RecordManager.createTempFile() did indeed lack a AccessController.doPrivileged() check. 👍
I improved your PR by:
- Formatting your changes
- Added missing imports
- Using a lambda expression for the doPrivileged()
- Removed the list of IOExceptions, as we only encounter a single exception, if deleting the fille fails.
I will merge your changes. Thanks for the fix!
flemming-n-larsen
added a commit
that referenced
this pull request
May 13, 2025
Contributor
Author
|
@flemming-n-larsen thanks for merging the PR! My team and I will be submitting this as a CVE, do let us know if you have any concerns! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The current implementation of createTempFile() has a security vulnerability related to privilege management. File operations should run with controlled privileges using Java's AccessController.doPrivileged() pattern to prevent security manager bypass or privilege escalation.
This vulnerability was identified in eclipse-ee4j/jersey@5794b7a and fixed.
References: