jfrog / jfrog/frogbot

Python Symlink escape is not prevented

Open
#1,031 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
372
Forks
107
Avg merge
2d 20h
Merged PRs (30d)
5

Description

Describe the bug

Bug 3: Symlink escape is not prevented

Description

Even if the path string passes validation, the code does not protect against symlinks that point outside the working directory.

Impact
  • A symlinked requirements file could allow reading or overwriting files outside the repository.
  • Potential security risk in CI environments.
Suggested Fix

Resolve and validate real paths using filepath.EvalSymlinks() before reading or writing.


Current behavior

If the target file path is a symlink, the code follows it without verifying where it resolves to. Even if the symlink points outside the repository, the file is still read or written.

Reproduction steps

Run As Is

Expected behavior

If the requirements/descriptor file is a symlink, Frogbot should:

Resolve the symlink target (realpath) and

Ensure the resolved target is still within the workspace.
If it points outside, the operation should be rejected with a clear error.

JFrog Frogbot version

LATEST

Package manager info

Python

Git provider

GitHub

JFrog Frogbot configuration yaml file

Default

Operating system type and version

ALL

JFrog Xray version

LATEST

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that reads or writes the requirements/descriptor file and the path-validation entry point. Use filepath.EvalSymlinks() as the stated direction, then verify that resolved targets remain within the workspace and that outside targets produce a clear rejection.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.