fix: finding triggers whenever there is a strcpy or ... in...#3602
Open
orbisai0security wants to merge 1 commit into
Open
fix: finding triggers whenever there is a strcpy or ... in...#3602orbisai0security wants to merge 1 commit into
orbisai0security wants to merge 1 commit into
Conversation
|
also suggest sending this to jemalloc instead and then pull it in here |
Member
|
This isn't a real bug though is it? |
Author
|
Thanks, after re-checking the code path, I agree this is not a demonstrated security bug as written. The original code uses strncpy(buf, b, buflen) followed immediately by buf[buflen - 1] = '\0', so the usual strncpy non-termination concern is already addressed here. My PR was based on a generic scanner finding and is better characterised as defensive cleanup rather than a confirmed vulnerability. Given this is vendored jemalloc code, I’m happy to take it upstream to jemalloc first if maintainers still prefer the snprintf style. I’ll also fix the DCO. |
…copy-fn security vulnerability Automated security fix generated by Orbis Security AI Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>
34ece62 to
3e3718e
Compare
Author
|
I've raised a PR in jemalloc. |
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.
Summary
Fix high severity security issue in
deps/jemalloc/src/malloc_io.c.Vulnerability
c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fndeps/jemalloc/src/malloc_io.c:102Description: Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available).
Changes
deps/jemalloc/src/malloc_io.cVerification
Automated security fix by OrbisAI Security