diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-25 04:56:15 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-29 17:29:38 +0800 |
commit | 9fb91fe1d63eb773a5400d9b8c54cb590aec392d (patch) | |
tree | 5dfa301964627041f8f8cd80aa85a0f02a9741d0 /lib | |
parent | d4dd0665f53e8636f9e7fbcac6a1072fe0a6cc36 (diff) | |
download | android-node-v8-9fb91fe1d63eb773a5400d9b8c54cb590aec392d.tar.gz android-node-v8-9fb91fe1d63eb773a5400d9b8c54cb590aec392d.tar.bz2 android-node-v8-9fb91fe1d63eb773a5400d9b8c54cb590aec392d.zip |
module: validate request in require.resolve.paths
PR-URL: https://github.com/nodejs/node/pull/18359
Fixes: https://github.com/nodejs/node/issues/18352
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/module.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/internal/module.js b/lib/internal/module.js index 5fa77a1112..c3dede40fa 100644 --- a/lib/internal/module.js +++ b/lib/internal/module.js @@ -27,6 +27,10 @@ function makeRequireFunction(mod) { require.resolve = resolve; function paths(request) { + if (typeof request !== 'string') { + throw new errors.Error('ERR_INVALID_ARG_TYPE', + 'request', 'string', request); + } return Module._resolveLookupPaths(request, mod, true); } |