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

Potential fix for code scanning alert no. 115: Insecure randomness #1921

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

robfrank
Copy link
Collaborator

Potential fix for https://github.com/ArcadeData/arcadedb/security/code-scanning/115

To fix the problem, we need to replace the use of java.util.Random with java.security.SecureRandom in the code. This change ensures that the random values generated are cryptographically secure and not easily predictable.

  1. Identify the lines where java.util.Random is used.
  2. Replace the instantiation of java.util.Random with java.security.SecureRandom.
  3. Ensure that the rest of the code remains functionally the same, only changing the source of randomness.

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>
@robfrank robfrank marked this pull request as ready for review January 16, 2025 13:05
Copy link

codacy-production bot commented Jan 16, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.26% 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b0c6d2b) 68199 43954 64.45%
Head commit (e7a66d0) 68200 (+1) 43775 (-179) 64.19% (-0.26%)

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 (#1921) 1 0 0.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

@lvca lvca added this to the 25.1.1 milestone Jan 16, 2025
@lvca lvca added the security label Jan 16, 2025
@robfrank robfrank merged commit 63a46b9 into main Jan 16, 2025
8 of 12 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