Skip to content

fix(zone.js): a path traversal attack in test#32392

Closed
mprobst wants to merge 1 commit intomasterfrom
path-traversal
Closed

fix(zone.js): a path traversal attack in test#32392
mprobst wants to merge 1 commit intomasterfrom
path-traversal

Conversation

@mprobst
Copy link
Copy Markdown
Contributor

@mprobst mprobst commented Aug 29, 2019

simple-server.js is vulnerable to a trivial path traversal attack, i.e. an
attacker can supply a path like ../../etc/passwd to read arbitrary files on
the server. This change fixes the issue by properly resolving the path, and then
only serving files under the current directory (as intended).

This is not really a security issue, given the code is not part of Angular, but
rather just testing infrastructure for Angular itself, and the CI servers are
not expected to contain confidential information, but still worth fixing for
code hygiene.

PR Checklist

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Path traversal attack issue.

What is the new behavior?

No more path traversals!

Does this PR introduce a breaking change?

  • Yes
  • No

@mprobst mprobst added type: bug/fix security Issues that generally impact framework or application security area: zones Issues related to zone.js labels Aug 29, 2019
@mprobst mprobst requested review from a team and JiaLiPassion August 29, 2019 10:14
@ngbot ngbot Bot modified the milestone: needsTriage Aug 29, 2019
@mprobst
Copy link
Copy Markdown
Contributor Author

mprobst commented Aug 29, 2019

This issue was reported by Sharon from Microsoft Vulnerability Research. Thanks!

`simple-server.js` is vulnerable to a trivial path traversal attack, i.e. an
attacker can supply a path like `../../etc/passwd` to read arbitrary files on
the server. This change fixes the issue by properly resolving the path, and then
only serving files under the current directory (as intended).

This is not really a security issue, given the code is not part of Angular, but
rather just testing infrastructure for Angular itself, and the CI servers are
not expected to contain confidential information, but still worth fixing for
code hygiene.
Copy link
Copy Markdown
Contributor

@JiaLiPassion JiaLiPassion left a comment

Choose a reason for hiding this comment

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

Thank you for the fix, LGTM.

@mprobst mprobst added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Aug 30, 2019
@ngbot
Copy link
Copy Markdown

ngbot Bot commented Aug 30, 2019

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "ci/circleci: test_aio" is failing
    failure status "ci/circleci: test_aio_local" is failing
    failure status "ci/circleci: test_aio_local_ivy" is failing
    pending missing required labels: PR target: *
    pending status "google3" is pending
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mhevery mhevery added the target: patch This PR is targeted for the next patch release label Aug 30, 2019
@mhevery mhevery closed this in d498314 Aug 30, 2019
mhevery pushed a commit that referenced this pull request Aug 30, 2019
`simple-server.js` is vulnerable to a trivial path traversal attack, i.e. an
attacker can supply a path like `../../etc/passwd` to read arbitrary files on
the server. This change fixes the issue by properly resolving the path, and then
only serving files under the current directory (as intended).

This is not really a security issue, given the code is not part of Angular, but
rather just testing infrastructure for Angular itself, and the CI servers are
not expected to contain confidential information, but still worth fixing for
code hygiene.

PR Close #32392
sabeersulaiman pushed a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
`simple-server.js` is vulnerable to a trivial path traversal attack, i.e. an
attacker can supply a path like `../../etc/passwd` to read arbitrary files on
the server. This change fixes the issue by properly resolving the path, and then
only serving files under the current directory (as intended).

This is not really a security issue, given the code is not part of Angular, but
rather just testing infrastructure for Angular itself, and the CI servers are
not expected to contain confidential information, but still worth fixing for
code hygiene.

PR Close angular#32392
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 30, 2019
@mprobst mprobst deleted the path-traversal branch December 3, 2019 08:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: zones Issues related to zone.js cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note security Issues that generally impact framework or application security target: patch This PR is targeted for the next patch release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants