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

[SECURITY] Weak security algorithm used by MacDigestManager #3057

Closed
AliIoT opened this issue Feb 16, 2022 · 2 comments
Closed

[SECURITY] Weak security algorithm used by MacDigestManager #3057

AliIoT opened this issue Feb 16, 2022 · 2 comments

Comments

@AliIoT
Copy link

AliIoT commented Feb 16, 2022

public static final String DIGEST_ALGORITHM = "SHA-1";
public static final String KEY_ALGORITHM = "HmacSHA1";

@mauricebarnum
Copy link
Contributor

This is required by the V2 wire protocol. I don't know what's required to remove that, but at the least I see that Pulsar is still defaulting to v2.

Maybe there's some sort of "yeah, sorry" annotation that can be added so code scanners wouldn't complain?

@dlg99
Copy link
Contributor

dlg99 commented Feb 18, 2022

DigestManager isn't used for the security but for the checksum/checksum validation.

CRC32 should be the default:

# The default digest type used for opening ledgers.
# digestType=CRC32
and
/**
* Get digest type used in bookkeeper admin.
*
* @return digest type
* @see #setBookieRecoveryDigestType
*/
public DigestType getBookieRecoveryDigestType() {
return DigestType.valueOf(this.getString(DIGEST_TYPE, DigestType.CRC32.toString()));
}

CRC32c is recommended for performance.

If you have use case for some other checksuming algorithm you can add it by extending DigestManager class and use configuration to set it.

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

No branches or pull requests

4 participants