Exploit database

GH-210f96c9ae62a71ba12fa055a1a1e5ed

spring-io/cve-2022-22976-bcrypt-skips-salt

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-22976

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files6

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/main/java/org/springframework/security/bcrypt/sample/Commands.java

Java · 867 bytes
package org.springframework.security.bcrypt.sample;

import org.springframework.boot.CommandLineRunner;
import org.springframework.security.bcrypt.sample.CheckCommand;
import org.springframework.security.bcrypt.sample.UpdateCommand;

public class Commands implements CommandLineRunner {

	private final CheckCommand check;

	private final UpdateCommand update;

	public Commands(CheckCommand check, UpdateCommand update) {
		this.check = check;
		this.update = update;
	}

	@Override
	public void run(String... args) {
		String command = determineCommand(args);
		if ("check".equals(command)) {
			this.check.run();
		} else if ("update".equals(command)) {
			this.update.run();
		} else {
			System.err.println("Unrecognized command");
		}
	}

	private String determineCommand(String[] args) {
		if (args.length == 0) {
			return "check";
		}
		return args[0];
	}
}