Skip to content

Commit

Permalink
Fix SecuritySupport TCCL leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhusar committed Dec 3, 2024
1 parent ae9008e commit 0f4e286
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
import java.security.AccessController;
import java.security.PrivilegedAction;

public class SecuritySupport {
/**
* SecuritySupport for the io.smallrye.opentelemetry.api package.
* <p>
* Do not move. Do not change class and method visibility to avoid being called from other
* {@link java.security.CodeSource}s, thus granting privilege escalation to external code.
*/
class SecuritySupport {
private SecuritySupport() {
throw new UnsupportedOperationException();
// Forbid inheritance!
}

public static ClassLoader getContextClassLoader() {
static ClassLoader getContextClassLoader() {
if (System.getSecurityManager() == null) {
return Thread.currentThread().getContextClassLoader();
} else {
Expand Down

0 comments on commit 0f4e286

Please sign in to comment.