Skip to content

Conversation

@cntigers
Copy link
Contributor

@cntigers cntigers commented May 6, 2024

Purpose of the pull request

fix: 15873

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@cntigers cntigers changed the title fix the git url command injection(#15873) [Improvement] fix the git url command injection(#15873) May 6, 2024
@wangxj3 wangxj3 added the first time contributor First-time contributor label May 6, 2024
Comment on lines +77 to +78
Assertions.assertFalse(GitProjectManager.isGitPath("git@& cat /etc/passwd >/poc.txt #"));
Assertions.assertFalse(GitProjectManager.isGitPath("git@| cat /etc/passwd >/poc.txt #"));
Copy link
Member

@ruanwenjun ruanwenjun May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a positive case which will return true.

Copy link
Contributor Author

@cntigers cntigers May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a positive case which will return true.

Thank you for your reminder. I found that there are already positive test cases during testing @ruanwenjun

exists test cases

Copy link
Member

@ruanwenjun ruanwenjun May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, please use mvn spotless:apply to format the code style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, please use mvn spotless:apply to format the code style.

Thank you for your advice,I have already resolved it.

@ruanwenjun ruanwenjun added this to the 3.2.2 milestone May 6, 2024
@ruanwenjun ruanwenjun changed the title [Improvement] fix the git url command injection(#15873) [Improvement] Fix the git url command injection(#15873) May 6, 2024
@ruanwenjun ruanwenjun changed the title [Improvement] Fix the git url command injection(#15873) [Improvement] Fix the git url command injection in pytorch task(#15873) May 6, 2024
@SbloodyS SbloodyS added improvement make more easy to user or prompt friendly 3.2.2 labels May 6, 2024
@cntigers cntigers requested a review from ruanwenjun May 7, 2024 00:59
@codecov-commenter
Copy link

codecov-commenter commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.86%. Comparing base (5c569b7) to head (17397ec).

❗ Current head 17397ec differs from pull request most recent head 3990e2c. Consider uploading reports for the commit 3990e2c to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##                dev   #15950      +/-   ##
============================================
- Coverage     39.93%   39.86%   -0.07%     
+ Complexity     5081     5064      -17     
============================================
  Files          1369     1369              
  Lines         45635    45635              
  Branches       4869     4868       -1     
============================================
- Hits          18224    18193      -31     
- Misses        25513    25544      +31     
  Partials       1898     1898              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@wangxj3 wangxj3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@rickchengx rickchengx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2024

@SbloodyS SbloodyS merged commit 60b019b into apache:dev May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.2.2 backend first time contributor First-time contributor improvement make more easy to user or prompt friendly ready-to-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Pytorch] There is no security check for GitProjectManager.getGitUrl, which could cause command injection

6 participants