diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index c16fc93e1aa9..1047ec5a3dbc 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -290,6 +290,10 @@ protected ClassLoader createClassLoader(List paths, ClassLoader parent, At List urls = new ArrayList<>(); for (File path : paths) { + if (path.getName().startsWith("jenkins-test-harness")) { + throw new IllegalStateException("Refusing to load the Jenkins test harness in production (via " + + atts.getValue("Short-Name") + ")"); + } urls.add(path.toURI().toURL()); } URLClassLoader2 classLoader;