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

New rule: Detect use of ".." in file scheme URIs #1867

Closed
ghost opened this issue May 1, 2020 · 4 comments
Closed

New rule: Detect use of ".." in file scheme URIs #1867

ghost opened this issue May 1, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented May 1, 2020

Even though the SARIF spec v2.1.0 doesn't prohibit it, the use of ".." segments in file scheme URIs is dangerous for reasons explained in oasis-tcs/sarif-spec#461. Add a warning-level analysis rule that reports the presence of ".." segments that are either (a) absolute, using the file: scheme, or (b) relative (because the user might resolve them to an absolute URI with the file: scheme).

@michaelcfanning
Copy link
Member

@eddynaka, can we please have someone author this check?

@eddynaka
Copy link
Collaborator

eddynaka commented Aug 12, 2021

@shaopeng-gh , can you work on this?

Below, some examples:
https://github.com/microsoft/sarif-sdk/tree/main/src/Sarif.Multitool.Library/Rules

@shaopeng-gh
Copy link
Collaborator

Got it, will check existing rule format and add a new one.

@shaopeng-gh
Copy link
Collaborator

Took a deeper look, I found this is already implemented:
SARIF1002.UrisMustBeValid
https://github.com/microsoft/sarif-sdk/blob/main/src/Sarif.Multitool.Library/Rules/SARIF1002.UrisMustBeValid.cs
possibly we implemented just the issue was not resolved at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants