uschindler commented on code in PR #14811:
URL: https://github.com/apache/lucene/pull/14811#discussion_r2156332399


##########
gradle/validation/forbidden-apis/defaults.all.txt:
##########
@@ -76,3 +76,15 @@ java.lang.Math#fma(float,float,float)
 java.lang.Math#fma(double,double,double)
 
 java.lang.Thread#sleep(**) @ Thread.sleep makes inefficient use of resources, 
introduces weird race conditions and slows down the code/tests. Not a scalable 
and good practice so we should prevent it creeping into lucene code
+
+@defaultMessage Using dangerous ClassLoader APIs may deserialize untrusted 
user input into bytecode, leading to remote code execution vulnerabilities
+java.lang.ClassLoader#defineClass(**)
+jdk.internal.misc.Unsafe#defineClass(**)
+jdk.internal.access.JavaLangAccess#defineClass(**)
+# forbidden complains it can't find this enclosed class
+# java.lang.invoke.MethodHandles.Lookup#defineClass(**)

Review Comment:
   In reality most of the signatures here are automatically enabled by default 
(in a more dynamic way).
   
   - `jdk.internal.*` is forbidden by default by disallowing all calls to non 
"public access" modules. See the "jdk-non-portable" bundled signatures: 
https://github.com/policeman-tools/forbidden-apis/wiki/BundledSignatures
   - `sun.misc.Unsafe` is also forbidden by default (same as before: 
https://github.com/policeman-tools/forbidden-apis/wiki/BundledSignatures). 
Adding it here brings more problems than it solves. Because `sun.misc.Unsafe` 
get removed around Java 25 (and especailly that method mentioned here), this 
will cause issues in later Java versions.
   
   Because of that all "internal" and "sun.misc" stuff should be removed here. 
The other ones are fine,



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to