-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from jenkinsci-cert/20161116-for-1.625
[SECURITY-360] 2016/11/16 security fix for 1.625
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
test/src/test/java/jenkins/security/security218/ysoserial/payloads/Ldap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package jenkins.security.security218.ysoserial.payloads; | ||
|
||
import jenkins.security.security218.ysoserial.util.PayloadRunner; | ||
|
||
import java.lang.reflect.Constructor; | ||
|
||
/** | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
public class Ldap extends PayloadRunner implements ObjectPayload<Object> { | ||
|
||
public Object getObject(final String command) throws Exception { | ||
// this is not a fully exploit, so we cannot honor the command, | ||
// but we want to check that we are blocking LdapAttribute | ||
Class<?> c = Class.forName("com.sun.jndi.ldap.LdapAttribute"); | ||
Constructor<?> ctr = c.getDeclaredConstructor(String.class); | ||
ctr.setAccessible(true); | ||
return ctr.newInstance("foo"); | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
PayloadRunner.run(Ldap.class, args); | ||
} | ||
} |