信息安全审计工具为一个过时的库升起了一个标志,在我们的webpack捆绑(由Vue CLI打包的) chunk-vendors.js文件中发现了已知的漏洞:
粤2.9.0
这个库似乎甚至没有全部包括在内,因为它只是一个简短的代码片段:
/*! Copyright (c) 2011, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 2.9.0 */if(void 0===a)var a={};a.lang={extend:function(e,n,i){if(!n||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var a=function(){};if(a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e,e.superclass=n.prototype,n.prototype.constructor==Object.prototype.constructor&&(n.prototype.constructor=n),i){var o;for(o in i)e.prototype[o]=i[o];var s=function(){},c=["toString","valueOf"];try{/MSIE/.test(r.userAgent)&&(s=function(t,e){for(o=0;o<c.length;o+=1){var n=c[o],r=e[n];"function"==typeof r&&r!=Object.prototype[n]&&(t[n]=r)}})}catch(t){}s(e.prototype,i)}}};
我本来希望找到由NPM安装并因此在package-lock.json中找到的YUI依赖项,但是锁文件中没有找到yui。
如何在未包含在chunk-vendors.js package-lock.json**,中的情况下包含该依赖项,或者如何调试?**
发布于 2021-05-27 06:25:05
为了找到有罪的依赖关系,您可以通过node_modules执行grep搜索,查找上面提到的版权文本。对于Windows,您可以使用PowerGREP或CLI命令findstr /s /i /m \<developer.yahoo.com\> *.* > results.out (s用于递归搜索,i用于区分大小写的搜索,m只打印文件名,而不是匹配的确切行)。
https://stackoverflow.com/questions/67700268
复制相似问题