FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

path: refactor to use more primordials by marsonya · Pull Request #37893 · nodejs/node · GitHub

/ node Public

path: refactor to use more primordials - #37893

Closed
marsonya wants to merge 1 commit into
nodejs:masterfrom
marsonya:primordials-path
Closed

path: refactor to use more primordials#37893
marsonya wants to merge 1 commit into
nodejs:masterfrom
marsonya:primordials-path

Conversation

marsonya commented Mar 24, 2021
edited
Loading

Copy link
Copy Markdown
Member

Replace code that's vulnerable to Prototype Pollution with Primordials.

nodejs-github-bot added needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. labels Mar 24, 2021

aduh95 commented Mar 24, 2021

Copy link
Copy Markdown
Contributor

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Benchmark CI didn't show any significant regression or improvement.

Details
                                                                                                 confidence improvement accuracy (*)    (**)   (***)
path/basename-posix.jsn=100000 pathext='/'                                                                       0.13 %       ±7.33%  ±9.75% ±12.69%
path/basename-posix.jsn=100000 pathext=''                                                                        1.75 %       ±7.49%  ±9.97% ±12.97%
path/basename-posix.jsn=100000 pathext='/foo'                                                                   -1.49 %       ±7.00%  ±9.32% ±12.12%
path/basename-posix.jsn=100000 pathext='foo'                                                                    -1.56 %       ±7.55% ±10.08% ±13.17%
path/basename-posix.jsn=100000 pathext='foo/bar.|.'                                                              6.64 %       ±9.03% ±12.07% ±15.82%
path/basename-posix.jsn=100000 pathext='foo/bar.'                                                                3.47 %       ±6.86%  ±9.14% ±11.90%
path/basename-posix.jsn=100000 pathext='/foo/.bar.baz'                                                          -2.67 %       ±6.54%  ±8.71% ±11.33%
path/basename-posix.jsn=100000 pathext='/foo/bar/baz/asdf/quux.html'                                             3.85 %       ±6.10%  ±8.12% ±10.57%
path/basename-posix.jsn=100000 pathext='/foo/bar/baz/asdf/quux.html|.html'                                       3.37 %       ±7.36%  ±9.83% ±12.88%
path/basename-posix.jsn=100000 pathext='/foo/.bar.baz|.baz'                                                     -1.46 %       ±5.82%  ±7.75% ±10.08%
path/basename-win32.jsn=100000 pathext=''                                                                       -2.69 %       ±4.78%  ±6.37%  ±8.30%
path/basename-win32.jsn=100000 pathext='C:\\\\'                                                                  0.08 %       ±5.31%  ±7.08%  ±9.24%
path/basename-win32.jsn=100000 pathext='C:\\\\foo'                                                              -2.24 %       ±4.76%  ±6.34%  ±8.27%
path/basename-win32.jsn=100000 pathext='D:\\\\foo\\\\.bar.baz'                                                   0.50 %       ±4.51%  ±6.01%  ±7.82%
path/basename-win32.jsn=100000 pathext='E:\\\\foo\\\\.bar.baz|.baz'                                             -1.83 %       ±5.34%  ±7.11%  ±9.27%
path/basename-win32.jsn=100000 pathext='foo'                                                                    -0.17 %       ±5.00%  ±6.66%  ±8.68%
path/basename-win32.jsn=100000 pathext='foo\\\\bar.|.'                                                           3.08 %       ±4.40%  ±5.85%  ±7.63%
path/basename-win32.jsn=100000 pathext='foo\\\\bar.'                                                            -1.35 %       ±5.49%  ±7.31%  ±9.52%
path/basename-win32.jsn=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html'                              0.43 %       ±3.79%  ±5.04%  ±6.56%
path/basename-win32.jsn=100000 pathext='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.html|.html'                       -0.67 %       ±4.95%  ±6.58%  ±8.57%
path/dirname-posix.jsn=100000 path='/'                                                                           0.10 %       ±4.03%  ±5.38%  ±7.03%
path/dirname-posix.jsn=100000 path=''                                                                           -1.38 %       ±3.89%  ±5.18%  ±6.74%
path/dirname-posix.jsn=100000 path='/foo'                                                                       -1.55 %       ±2.95%  ±3.93%  ±5.12%
path/dirname-posix.jsn=100000 path='foo'                                                                        -0.24 %       ±3.43%  ±4.57%  ±5.96%
path/dirname-posix.jsn=100000 path='/foo/bar'                                                                    0.77 %       ±5.08%  ±6.77%  ±8.81%
path/dirname-posix.jsn=100000 path='foo/bar'                                                                    -2.44 %       ±3.44%  ±4.58%  ±5.97%
path/dirname-posix.jsn=100000 path='/foo/bar/baz/asdf/quux'                                                      2.01 %       ±3.95%  ±5.26%  ±6.84%
path/dirname-win32.jsn=100000 path=''                                                                           -2.33 %       ±5.25%  ±6.98%  ±9.09%
path/dirname-win32.jsn=100000 path='\\\\'                                                                        0.99 %       ±5.62%  ±7.48%  ±9.74%
path/dirname-win32.jsn=100000 path='C:\\\\foo\\\\bar'                                                            1.86 %       ±5.39%  ±7.17%  ±9.33%
path/dirname-win32.jsn=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux'                                     2.66 %       ±5.63%  ±7.49%  ±9.76%
path/dirname-win32.jsn=100000 path='\\\\foo'                                                                     1.00 %       ±5.23%  ±6.97%  ±9.07%
path/dirname-win32.jsn=100000 path='foo'                                                                        -1.68 %       ±4.56%  ±6.06%  ±7.89%
path/dirname-win32.jsn=100000 path='foo\\\\bar'                                                                 -2.06 %       ±5.37%  ±7.14%  ±9.30%
path/extname-posix.jsn=100000 path='/'                                                                           0.72 %       ±4.69%  ±6.25%  ±8.14%
path/extname-posix.jsn=100000 path=''                                                                            0.77 %       ±3.06%  ±4.07%  ±5.30%
path/extname-posix.jsn=100000 path='/foo'                                                                        0.47 %       ±3.61%  ±4.81%  ±6.27%
path/extname-posix.jsn=100000 path='foo/.bar.baz'                                                         *     -4.39 %       ±4.23%  ±5.63%  ±7.33%
path/extname-posix.jsn=100000 path='/foo/bar/baz/asdf/quux'                                                     -0.30 %       ±3.85%  ±5.13%  ±6.68%
path/extname-posix.jsn=100000 path='/foo/bar/baz/asdf/quux.foobarbazasdfquux'                                    0.78 %       ±4.19%  ±5.58%  ±7.27%
path/extname-posix.jsn=100000 path='foo/bar/...baz.quux'                                                  *      4.32 %       ±4.06%  ±5.41%  ±7.04%
path/extname-posix.jsn=100000 path='foo/bar/..baz.quux'                                                          3.10 %       ±4.95%  ±6.60%  ±8.62%
path/extname-posix.jsn=100000 path='index'                                                                       0.09 %       ±4.78%  ±6.36%  ±8.30%
path/extname-posix.jsn=100000 path='index.html'                                                                  0.62 %       ±4.98%  ±6.63%  ±8.63%
path/extname-win32.jsn=100000 path=''                                                                            1.23 %       ±4.31%  ±5.73%  ±7.47%
path/extname-win32.jsn=100000 path='\\\\'                                                                 *      5.00 %       ±3.94%  ±5.26%  ±6.89%
path/extname-win32.jsn=100000 path='C:\\\\foo'                                                                  -1.31 %       ±4.30%  ±5.72%  ±7.45%
path/extname-win32.jsn=100000 path='D:\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux'                                     0.87 %       ±3.94%  ±5.24%  ±6.82%
path/extname-win32.jsn=100000 path='foo\\\\.bar.baz'                                                            -2.71 %       ±4.58%  ±6.12%  ±8.01%
path/extname-win32.jsn=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\quux.foobarbazasdfquux'                     2.31 %       ±4.16%  ±5.53%  ±7.21%
path/extname-win32.jsn=100000 path='foo\\\\bar\\\\...baz.quux'                                                  -0.02 %       ±4.02%  ±5.35%  ±6.97%
path/extname-win32.jsn=100000 path='foo\\\\bar\\\\..baz.quux'                                                   -0.35 %       ±9.45% ±12.61% ±16.46%
path/extname-win32.jsn=100000 path='index'                                                                       1.50 %       ±4.08%  ±5.44%  ±7.10%
path/extname-win32.jsn=100000 path='index.html'                                                                  2.04 %       ±6.09%  ±8.13% ±10.62%
path/format-posix.jsn=1000000 props='/|/home/user/dir|index.html|.html|index'                                   -1.23 %       ±2.77%  ±3.69%  ±4.81%
path/format-win32.jsn=1000000 props='C:\\\\|C:\\\\path\\\\dir|index.html|.html|index'                           -0.11 %       ±2.41%  ±3.21%  ±4.19%
path/isAbsolute-posix.jsn=100000 path='.'                                                                       -0.87 %       ±4.64%  ±6.18%  ±8.05%
path/isAbsolute-posix.jsn=100000 path=''                                                                         1.45 %       ±4.56%  ±6.07%  ±7.90%
path/isAbsolute-posix.jsn=100000 path='bar/baz'                                                                 -1.03 %       ±4.34%  ±5.77%  ±7.51%
path/isAbsolute-posix.jsn=100000 path='/baz/..'                                                                 -0.29 %       ±4.17%  ±5.55%  ±7.22%
path/isAbsolute-posix.jsn=100000 path='/foo/bar'                                                                -0.27 %       ±5.16%  ±6.89%  ±9.03%
path/isAbsolute-win32.jsn=100000 path='.'                                                                        1.28 %       ±3.57%  ±4.76%  ±6.20%
path/isAbsolute-win32.jsn=100000 path=''                                                                         3.14 %       ±4.21%  ±5.61%  ±7.30%
path/isAbsolute-win32.jsn=100000 path='bar\\\\baz'                                                               2.90 %       ±3.74%  ±4.97%  ±6.49%
path/isAbsolute-win32.jsn=100000 path='C:\\\\baz\\\\..'                                                          4.37 %       ±4.43%  ±5.90%  ±7.71%
path/isAbsolute-win32.jsn=100000 path='C:baz\\\\..'                                                             -0.07 %       ±3.06%  ±4.07%  ±5.30%
path/isAbsolute-win32.jsn=100000 path='//server'                                                                -2.33 %       ±4.58%  ±6.09%  ±7.95%
path/join-posix.jsn=100000 paths='/foo|bar||baz/asdf|quux|..'                                             *      3.84 %       ±3.18%  ±4.23%  ±5.50%
path/join-win32.jsn=100000 paths='C:\\\\foo|bar||baz\\\\asdf|quux|..'                                            2.59 %       ±3.71%  ±4.93%  ±6.42%
path/makeLong-win32.jsn=100000 path='C:\\\\foo'                                                                 -1.27 %       ±4.59%  ±6.11%  ±7.96%
path/makeLong-win32.jsn=100000 path='\\\\\\\\?\\\\foo'                                                          -0.27 %       ±5.05%  ±6.71%  ±8.74%
path/makeLong-win32.jsn=100000 path='\\\\\\\\foo\\\\bar'                                                         2.05 %       ±4.41%  ±5.87%  ±7.64%
path/makeLong-win32.jsn=100000 path='foo\\\\bar'                                                                 3.85 %       ±4.29%  ±5.71%  ±7.43%
path/normalize-posix.jsn=100000 path='/../'                                                                     -2.20 %       ±4.52%  ±6.05%  ±7.94%
path/normalize-posix.jsn=100000 path='.'                                                                         0.29 %       ±6.09%  ±8.11% ±10.57%
path/normalize-posix.jsn=100000 path=''                                                                         -1.17 %       ±4.43%  ±5.92%  ±7.77%
path/normalize-posix.jsn=100000 path='/foo'                                                                     -0.68 %       ±4.33%  ±5.77%  ±7.52%
path/normalize-posix.jsn=100000 path='/foo/bar'                                                                  2.09 %       ±4.16%  ±5.54%  ±7.21%
path/normalize-posix.jsn=100000 path='/foo/bar//baz/asdf/quux/..'                                                2.40 %       ±3.99%  ±5.31%  ±6.91%
path/normalize-win32.jsn=100000 path='.'                                                                         1.32 %       ±3.63%  ±4.83%  ±6.29%
path/normalize-win32.jsn=100000 path=''                                                                         -1.17 %       ±4.07%  ±5.42%  ±7.06%
path/normalize-win32.jsn=100000 path='C:\\\\..\\\\'                                                             -0.32 %       ±3.77%  ±5.01%  ±6.52%
path/normalize-win32.jsn=100000 path='C:\\\\foo'                                                                -0.02 %       ±4.27%  ±5.68%  ±7.40%
path/normalize-win32.jsn=100000 path='C:\\\\foo\\\\bar'                                                          1.86 %       ±5.61%  ±7.46%  ±9.71%
path/normalize-win32.jsn=100000 path='C:\\\\foo\\\\bar\\\\\\\\baz\\\\asdf\\\\quux\\\\..'                        -1.30 %       ±4.09%  ±5.45%  ±7.09%
path/parse-posix.jsn=100000 path='/'                                                                            -0.40 %       ±5.60%  ±7.46%  ±9.72%
path/parse-posix.jsn=100000 path=''                                                                             -1.97 %       ±4.71%  ±6.27%  ±8.18%
path/parse-posix.jsn=100000 path='/foo'                                                                         -1.81 %       ±6.18%  ±8.23% ±10.74%
path/parse-posix.jsn=100000 path='foo/bar'                                                                      -5.12 %       ±7.00%  ±9.31% ±12.12%
path/parse-posix.jsn=100000 path='/foo/bar.baz'                                                                 -1.40 %       ±6.09%  ±8.13% ±10.64%
path/parse-posix.jsn=100000 path='foo/.bar.baz'                                                                 -1.97 %       ±4.43%  ±5.90%  ±7.68%
path/parse-posix.jsn=100000 path='/foo/bar/baz/asdf/.quux'                                                       0.32 %       ±5.64%  ±7.51%  ±9.77%
path/parse-win32.jsn=100000 path=''                                                                             -0.93 %       ±6.53%  ±8.70% ±11.34%
path/parse-win32.jsn=100000 path='C:\\\\'                                                                       -2.17 %       ±6.67%  ±8.88% ±11.56%
path/parse-win32.jsn=100000 path='C:\\\\foo'                                                                    -4.94 %       ±6.18%  ±8.26% ±10.83%
path/parse-win32.jsn=100000 path='E:\\\\foo\\\\bar.baz'                                                         -5.15 %       ±6.26%  ±8.33% ±10.85%
path/parse-win32.jsn=100000 path='\\\\foo'                                                                      -6.82 %       ±6.98%  ±9.33% ±12.22%
path/parse-win32.jsn=100000 path='foo\\\\bar'                                                                    5.51 %       ±6.20%  ±8.25% ±10.74%
path/parse-win32.jsn=100000 path='foo\\\\.bar.baz'                                                               1.95 %       ±5.98%  ±7.97% ±10.39%
path/parse-win32.jsn=100000 path='\\\\foo\\\\bar\\\\baz\\\\asdf\\\\.quux'                                       -5.10 %       ±6.22%  ±8.27% ±10.77%
path/relative-posix.jsn=100000 paths='/|/'                                                                      -0.61 %       ±7.04%  ±9.38% ±12.26%
path/relative-posix.jsn=100000 paths='/data/orandea/test/aaa|/data/orandea/impl/bbb'                             1.61 %       ±3.59%  ±4.79%  ±6.26%
path/relative-posix.jsn=100000 paths='/foo/bar/baz/quux|/'                                                       2.77 %       ±3.31%  ±4.40%  ±5.73%
path/relative-posix.jsn=100000 paths='/foo/bar/baz/quux|/foo/bar/baz/quux'                                       2.43 %       ±5.61%  ±7.46%  ±9.71%
path/relative-posix.jsn=100000 paths='/foo/bar/baz/quux|/var/log'                                                0.76 %       ±3.48%  ±4.63%  ±6.03%
path/relative-posix.jsn=100000 paths='/|/var'                                                                    1.04 %       ±6.34%  ±8.43% ±10.97%
path/relative-posix.jsn=100000 paths='/var|/bin'                                                                -2.29 %       ±5.55%  ±7.38%  ±9.62%
path/relative-win32.jsn=100000 paths='C:\\\\|D:\\\\'                                                            -0.06 %       ±3.92%  ±5.23%  ±6.82%
path/relative-win32.jsn=100000 paths='C:\\\\foo\\\\bar\\\\baz|C:\\\\foo\\\\bar\\\\baz'                           0.68 %       ±3.86%  ±5.14%  ±6.70%
path/relative-win32.jsn=100000 paths='C:\\\\foo\\\\BAR\\\\BAZ|C:\\\\foo\\\\bar\\\\baz'                           2.24 %       ±4.77%  ±6.35%  ±8.26%
path/relative-win32.jsn=100000 paths='C:\\\\foo\\\\bar\\\\baz\\\\quux|C:\\\\'                                    0.31 %       ±3.31%  ±4.41%  ±5.76%
path/relative-win32.jsn=100000 paths='C:\\\\orandea\\\\test\\\\aaa|C:\\\\orandea\\\\impl\\\\bbb'                -1.05 %       ±3.38%  ±4.51%  ±5.88%
path/resolve-posix.jsn=100000 paths='|'                                                                          1.04 %       ±4.50%  ±5.99%  ±7.80%
path/resolve-posix.jsn=100000 paths=''                                                                           1.70 %       ±3.97%  ±5.28%  ±6.88%
path/resolve-posix.jsn=100000 paths='a/b/c/|../../..'                                                            0.30 %       ±3.13%  ±4.17%  ±5.42%
path/resolve-posix.jsn=100000 paths='foo/bar|/tmp/file/|..|a/../subfile'                                         2.07 %       ±4.15%  ±5.52%  ±7.19%
path/resolve-win32.jsn=100000 paths='|'                                                                         -2.56 %       ±4.13%  ±5.49%  ±7.15%
path/resolve-win32.jsn=100000 paths=''                                                                          -2.13 %       ±4.70%  ±6.26%  ±8.16%
path/resolve-win32.jsn=100000 paths='c:/blah\\\\blah|d:/games|c:../a'                                            0.24 %       ±3.43%  ±4.57%  ±5.95%
path/resolve-win32.jsn=100000 paths='c:/ignore|d:\\\\a/b\\\\c/d|\\\\e.exe'                                       0.85 %       ±4.31%  ±5.74%  ±7.47%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 120 comparisons, you can thus
expect the following amount of false-positive results:
  6.00 false positives, when considering a   5% risk acceptance (*, **, ***),
  1.20 false positives, when considering a   1% risk acceptance (**, ***),
  0.12 false positives, when considering a 0.1% risk acceptance (***)

aduh95 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 25, 2021

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Lxxyx pushed a commit that referenced this pull request Apr 1, 2021
PR-URL: #37893
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>

Lxxyx commented Apr 1, 2021

Copy link
Copy Markdown
Member

Landed in 3ef9562

Lxxyx closed this Apr 1, 2021
MylesBorins pushed a commit that referenced this pull request Apr 4, 2021
PR-URL: #37893
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
MylesBorins mentioned this pull request Apr 4, 2021
targos pushed a commit that referenced this pull request May 30, 2021
PR-URL: #37893
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
PR-URL: #37893
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #37893
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL