fix: remove unsafe exec() in helper.h#235
Open
orbisai0security wants to merge 1 commit intoalibaba:mainfrom
Open
fix: remove unsafe exec() in helper.h#235orbisai0security wants to merge 1 commit intoalibaba:mainfrom
orbisai0security wants to merge 1 commit intoalibaba:mainfrom
Conversation
Multiple memcpy operations throughout the codebase copy data without validating that the source buffer contains sufficient bytes or that the destination buffer has adequate capacity Resolves V-001
Comment on lines
291
to
+296
| offset += sizeof(uint64_t); | ||
|
|
||
| if (!data_ptr) { | ||
| LOG_ERROR("Invalid data pointer for tag count"); | ||
| return IndexError_ReadData; | ||
| } |
There was a problem hiding this comment.
offset incremented before null check — inconsistent ordering
offset += sizeof(uint64_t) is executed on line 291 before the null check on line 293. The other three null checks added by this PR are all placed immediately after the read() return-value guard, before any subsequent state mutation. To be consistent and to guard against unintended state modification before early-return, move the null check above the offset increment. The same ordering issue exists in flow.h at the corresponding location (line 262).
Suggested change
| offset += sizeof(uint64_t); | |
| if (!data_ptr) { | |
| LOG_ERROR("Invalid data pointer for tag count"); | |
| return IndexError_ReadData; | |
| } | |
| if (!data_ptr) { | |
| LOG_ERROR("Invalid data pointer for tag count"); | |
| return IndexError_ReadData; | |
| } | |
| offset += sizeof(uint64_t); |
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
tools/core/helper.h.Vulnerability
V-001tools/core/helper.h:224Description: Multiple memcpy operations throughout the codebase copy data without validating that the source buffer contains sufficient bytes or that the destination buffer has adequate capacity. In helper.h:22...
Changes
tools/core/flow.htools/core/helper.hVerification
Automated security fix by OrbisAI Security