Skip to content

Applied os.path.basename() to variable used in os.path.join that come…#1079

Merged
jcatera-splunk merged 1 commit intomainfrom
VULN-53953-jcatera
Jan 24, 2026
Merged

Applied os.path.basename() to variable used in os.path.join that come…#1079
jcatera-splunk merged 1 commit intomainfrom
VULN-53953-jcatera

Conversation

@jcatera-splunk
Copy link
Contributor

@jcatera-splunk jcatera-splunk commented Jan 23, 2026

…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.

…s from an external source (like the regex matches from markdown files).
@jcatera-splunk jcatera-splunk requested a review from a team as a code owner January 23, 2026 03:42
@jnino-splunk
Copy link
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!

@jcatera-splunk jcatera-splunk merged commit df915f6 into main Jan 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants