question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn if fake secure random is on the classpath

See original GitHub issue

In light of https://github.com/scalatest/scalatest/issues/2116, I think it would be a very good thing if there was more hand-holding regarding the fake secure random artifact. Since downstreams can receive this dependency transitively, it is really not a nice situation for them if an upstream accidentally forgets to add % Test or worse.

This is a similar situation to https://github.com/scala-js/scala-js/issues/4610 or the warning for the global EC. Warn, because it’s probably not what the user wants, and give actionable instructions how to fix it.

If the sbt-plugin could make a best effort to check the classpath for the fake secure random and log a warning that alerts users to its presence. Or honestly even raise a fatal error, unless you explicitly opt-in a setting clearly indicating that this is what you want to do. Although the dependency can be inherited transitively, this opt-in cannot be, which is the point.

Or maybe this could be done on the linker level, IDK.

Thanks.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

4reactions
sjrdcommented, Apr 13, 2022

I think the popularity of the JSDOM env for testing, which doesn’t support WebCrypto, throws a wrench in this. Maybe that’s the technical problem that needs to be solved.

Trying to address that at the source: https://github.com/jsdom/jsdom/pull/3352

1reaction
armanbilgecommented, Jun 3, 2022

I think that JSDOM is only modern JSEnv that doesn’t currently support cryptographically secure random numbers. But Seb has already fixed that in https://github.com/jsdom/jsdom/pull/3352 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Java SecureRandom Class | Baeldung
SecureRandom in any security decisions. It produces cryptographically strong random values by using a cryptographically strong pseudo-random ...
Read more >
jar hell in test classpath when running with JDK 1.8.0_66 on ...
Trying to run a test that extends ESIntegTestCase with Elasticsearch 2.0.0, getting this: java.lang.RuntimeException: found jar hell in test ...
Read more >
Bug Pattern: PREDICTABLE_RANDOM - Find Security Bugs
Predictable pseudorandom number generator. Bug Pattern: PREDICTABLE_RANDOM. The use of a predictable random value can lead to vulnerabilities when used in ...
Read more >
Android Lint Checks - Android Studio Project Site
When you generate a resource alias, the resource you are pointing to must be ... When you create Android projects, the classpath is...
Read more >
Slow startup on Tomcat 7.0.57 because of SecureRandom
The secure random calls may be blocking as there is not enough entropy to feed them in /dev/random. If you have the line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found