项目打包后,有个taro.js里存在taro.com的外链,被安全扫描出问题,需要移除

pn9klfpd  于 9个月前  发布在  其他
关注(0)|答案(2)|浏览(111)

相关平台

微信小程序

小程序基础库: 3.4.4
使用框架: Vue 3

复现步骤

运行 taro build --type weapp 后,打开文件 dist/taro.js ,里面有多个外链

期望结果

清除外部链接

实际结果

依然存在taro.com和jd.com

环境信息

  1. 👽 Taro v3.6.27
  2. Taro CLI 3.6.27 environment info:
  3. System:
  4. OS: Windows 11 10.0.22631
  5. Binaries:
  6. Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
  7. npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  8. npmPackages:
  9. @tarojs/cli: 3.6.8 => 3.6.8
  10. @tarojs/components: 3.6.8 => 3.6.8
  11. @tarojs/helper: 3.6.8 => 3.6.8
  12. @tarojs/plugin-framework-vue3: 3.6.8 => 3.6.8
  13. @tarojs/plugin-html: 3.6.8 => 3.6.8
  14. @tarojs/plugin-platform-alipay: 3.6.8 => 3.6.8
  15. @tarojs/plugin-platform-h5: 3.6.8 => 3.6.8
  16. @tarojs/plugin-platform-jd: 3.6.8 => 3.6.8
  17. @tarojs/plugin-platform-qq: 3.6.8 => 3.6.8
  18. @tarojs/plugin-platform-swan: 3.6.8 => 3.6.8
  19. @tarojs/plugin-platform-tt: 3.6.8 => 3.6.8
  20. @tarojs/plugin-platform-weapp: 3.6.8 => 3.6.8
  21. @tarojs/runtime: 3.6.8 => 3.6.8
  22. @tarojs/shared: 3.6.8 => 3.6.8
  23. @tarojs/taro: 3.6.8 => 3.6.8
  24. @tarojs/taro-loader: 3.6.8 => 3.6.8
  25. @tarojs/webpack5-runner: 3.6.8 => 3.6.8
  26. babel-preset-taro: 3.6.8 => 3.6.8
  27. eslint-config-taro: 3.6.8 => 3.6.8

补充信息

我用taro开发一个小程序,上线后安全公司扫描小程序后得出了几个安全漏洞。
一个是通过 https://taro.comhttps://ftcms.jd.com 的外部链接扫描出了 ThinkPHP 5.x 的多个漏洞,这在我的系统里是完全用不上的,只是taro build完后才出现的链接。
另一个则比较让人费解, 检测小程序使用硬编码的加密密钥 ,请问taro开发人员,是否有使用这种风险代码?

ohfgkhjo

ohfgkhjo1#

问题一: taro.js 存在外链 https://taro.com

这是 new URL() 的默认链接,并不会影响实际应用。不管换成什么链接,即使是 about:blank ,也很难说公司安全漏洞检查系统会不会报告异常。
taro/packages/taro-runtime/src/bom/location.ts

Lines 19 to 26 in 851500f

| | constINIT_URL='https://taro.com' |
| | constcache=newRuntimeCache('location') |
| | |
| | classTaroLocationextendsEvents{ |
| | /* private property */ |
| | #url =newURL(INIT_URL) |
| | #noCheckUrl =false |
| | #window: any |

问题二:检测小程序使用硬编码的加密密钥

这个可以具体一点吗?

展开查看全部
gopyfrb3

gopyfrb32#

taro.js 存在外链 https://taro.com 可以改成自定义吗

相关问题