Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java: unsafe file traversal #116

Merged

Conversation

hrideshmg
Copy link
Contributor

@hrideshmg hrideshmg commented Feb 24, 2025

Description

This PR introduces a new java security checker named unsafe_file_traversal to detect potential path traversal vulnerabilities in Java. Improper handling of file paths, especially when constructed dynamically with user input, can allow attackers to access unauthorized files, leading to security risks such as information disclosure, arbitrary file access, or file manipulation.

Detection Logic

The checker flags the following unsafe patterns:

  • Direct usage of File() with user-controlled input
  • File() with string concatenation involving user input
  • File() with String.format() where user input is used in formatting

Exclusions

This checker excludes test directories and vendor dependencies to reduce false positives.

Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
globstar ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2025 8:50pm

@hrideshmg hrideshmg force-pushed the java_file_traversal branch from fb17823 to 9870c71 Compare March 6, 2025 20:50
@sourya-deepsource sourya-deepsource merged commit d00f0d3 into DeepSourceCorp:master Mar 7, 2025
3 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.

2 participants