This product is not supported for your selected Datadog site. ().
이 페이지는 아직 영어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Metadata

ID: php-security/avoid-sha224

Language: PHP

Severity: Warning

Category: Security

CWE: 328

Description

This rule discourages the use of the SHA224 hashing algorithm and its variants such as SHA512/224 and SHA3-224. These hash functions produce shorter digests that offer less collision resistance compared to stronger alternatives like SHA256 or SHA512. Using SHA224 can weaken the security of your application, making it more vulnerable to collision attacks and reducing overall cryptographic strength.

To ensure robust security, it is important to use more secure hash algorithms such as SHA256 or SHA3-256, which provide longer digests and better resistance against cryptographic attacks. When calling PHP’s hash or hash_hmac functions, specify these stronger algorithms explicitly, for example: hash('sha256', $content, $key);.

Non-Compliant Code Examples

<?
hash('sha224', $content, $key);
hash('sha512/224', $content, $key);
hash('sha3-224', $content, $key);
hash_hmac('sha224', $content, $key);
hash_hmac('sha512/224', $content, $key);
hash_hmac('sha3-224', $content, $key);
hash_hmac("sha3-224", $content, $key);
?>

Compliant Code Examples

<?
hash('sha256', $content, $key);
?>
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

원활한 통합. Datadog Code Security를 경험해 보세요