Applied os.path.basename() to variable used in os.path.join that come…#1079
Merged
jcatera-splunk merged 1 commit intomainfrom Jan 24, 2026
Merged
Applied os.path.basename() to variable used in os.path.join that come…#1079jcatera-splunk merged 1 commit intomainfrom
jcatera-splunk merged 1 commit intomainfrom
Conversation
…s from an external source (like the regex matches from markdown files).
Contributor
|
Here you go https://splunk.atlassian.net/browse/VULN-53953 I don't understand the VULN and the fix so some more details would be great! |
jnino-splunk
approved these changes
Jan 23, 2026
adasplunk
approved these changes
Jan 24, 2026
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.
…s from an external source (like the regex matches from markdown files).
Ticket: VULN-53953
Description of issue and solution:
Semgrep is flagging a Path Traversal vulnerability (CWE-22).
This vulnerability is often called a "Tarball" or "Zip Slip" vulnerability because it uses the same exploit technique: using ../ in a filename to write files outside of the intended directory.
The PR corrects the handling of the image_filename and output_path. Specifically, in process_images and your do_... functions:
process_images: You take a filename directly from a regex match (image_filename = p.group(1)) and join it to a path: os.path.join(OUTPUT_IMAGE_PATH, monitor + "/" + image_filename).
do_smart_agent_monitor: You take an output_filename from a function and join it: os.path.join(OUTPUT_DOC_PATH, output_filename)
I've wrapped path references with
os.path.join.