BAU-27506: Use of Hardcoded Cryptographic Key fixes#1
Open
remus-iesan-natterbox wants to merge 2 commits intomasterfrom
Open
BAU-27506: Use of Hardcoded Cryptographic Key fixes#1remus-iesan-natterbox wants to merge 2 commits intomasterfrom
remus-iesan-natterbox wants to merge 2 commits intomasterfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ code/snyk check is complete. No issues have been found. (View Details) |
codemedic
reviewed
Oct 22, 2025
Collaborator
codemedic
left a comment
There was a problem hiding this comment.
LGTM, except one thing.
Can you please add more context, in commit messages and code comments. Include IDs such as CVE, NVD, etc for future reference.
I can see that you have added comments to the PR but that is easily forgotten about once the PR is closed.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
🛡️ The following SAST misconfigurations have been detected
| NAME | FILE | ||
|---|---|---|---|
| Prevent Format String Vulnerabilities in Snprintf Usage | src/request.c | View in code | |
| Prevent Format String Vulnerabilities in Snprintf Usage | src/request.c | View in code | |
| Prevent Format String Vulnerabilities in Snprintf Usage | src/request.c | View in code | |
| Improper handling of non-null-terminated strings in strlen functions | src/request.c | View in code | |
| Improper handling of non-null-terminated strings in strlen functions | src/request.c | View in code |
Collaborator
|
Just spotted ... this PR must be based on |
codemedic
requested changes
Nov 19, 2025
Collaborator
codemedic
left a comment
There was a problem hiding this comment.
See my last comment about redmatter-master
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request addresses and resolves Snyk-reported issues regarding "Use of Hardcoded Cryptographic Key" in
src/request.c(lines 1023 and 1765). After thorough review, these findings are false positives and do not represent any real security risk.Snyk Findings: False Positive Analysis
"AWS4"as a cryptographic key."AWS4"is a required prefix for AWS Signature Version 4 signing, as documented in the official AWS Signature Version 4 documentation. It is not a secret or a sensitive cryptographic key.Refactoring Details
Inline string values such as
"AWS4","s3", and"aws4_request"have been replaced with named constants:AWS4_PREFIXAWS4_SERVICEAWS4_REQUESTAWS Signature Version 4 Context
The strings in question are mandated by the AWS Signature Version 4 protocol:
AWS4is a fixed prefix for key derivation.aws4_requestis a required terminator during request signing.s3represents the AWS service name for S3 requests.These values are public, documented, and required for compatibility with AWS. The actual signing key is securely derived and never exposed or stored in the codebase.
Security Assessment
The code changes and existing logic do not expose any sensitive cryptographic materials.
Code is fully compliant with the AWS specification and follows best practices for key handling.
The Snyk errors (lines 1023 and 1765) are not actionable and can be safely disregarded.
Additional Notes
This PR does not alter the operation or the output of the signing process. It is a refactor for clarity and maintainability only.
All tests pass successfully and AWS Signature Version 4 functionality remains unchanged and fully compatible.
References
Summary:
This PR refactors string literals required by AWS Signature Version 4 into named constants, clarifies the security concerns raised by Snyk with detailed reasoning, and confirms there is no risk of exposing sensitive cryptographic keys in this repository.