Skip to content
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

Fix code scanning alert no. 157: Insecure randomness #1917

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

robfrank
Copy link
Collaborator

Fixes https://github.com/ArcadeData/arcadedb/security/code-scanning/157

To fix the problem, we need to replace the usage of java.util.Random with java.security.SecureRandom in the code. This ensures that the random numbers generated are cryptographically secure and suitable for security-sensitive operations.

  • Replace instances of new Random() with new SecureRandom().
  • Ensure that the import statement for java.security.SecureRandom is added to the file.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link

codacy-production bot commented Jan 15, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.24% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f405cc5) 64561 42998 66.60%
Head commit (afadff5) 64561 (+0) 42841 (-157) 66.36% (-0.24%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1917) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@robfrank robfrank requested a review from lvca January 15, 2025 13:31
Copy link
Collaborator Author

@robfrank robfrank left a comment

Choose a reason for hiding this comment

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

LGTM

@lvca WDYT?

@lvca lvca added the security label Jan 15, 2025
@lvca lvca added this to the 25.1.1 milestone Jan 15, 2025
@robfrank robfrank marked this pull request as ready for review January 15, 2025 22:16
@robfrank robfrank merged commit 561050e into main Jan 15, 2025
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants