Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baomitu.com的文件可能是修改过的 #211

Open
lvzhenbo opened this issue Oct 10, 2024 · 6 comments
Open

baomitu.com的文件可能是修改过的 #211

lvzhenbo opened this issue Oct 10, 2024 · 6 comments

Comments

@lvzhenbo
Copy link

https://lib.baomitu.com/jquery/2.1.4/jquery.min.js
https://code.jquery.com/jquery-2.1.4.min.js
现在资源加载可以添加hash,如果文件修改过hash不一致会被浏览器拦截

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Oct 11, 2024

看到第一眼认为是供应链投毒,详见这个: https://v2ex.com/t/1056428

经过下面的验证,排除供应链投毒

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Oct 11, 2024

验证脚本

curl -LSso /tmp/jquery.min.js https://code.jquery.com/jquery-2.1.4.min.js && md5sum /tmp/jquery.min.js


curl -LSso /tmp/baomitu-jquery.min.js https://lib.baomitu.com/jquery/2.1.4/jquery.min.js && md5sum /tmp/baomitu-jquery.min.js


curl -LSso /tmp/cloudflare-jquery.min.js  https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js && md5sum /tmp/cloudflare-jquery.min.js 


curl -LSo /tmp/fastly-jsdelivr-jquery.min.js https://fastly.jsdelivr.net/npm/[email protected]/dist/jquery.min.js && md5sum  /tmp/fastly-jsdelivr-jquery.min.js

curl -LSo /tmp/google-jquery.min.js https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js && md5sum   /tmp/google-jquery.min.js

验证结果结果:
image

源主机 hash(md5) 源地址
code.jquery.com f9c7afd05729f10f55b689f36bb20172 https://code.jquery.com/jquery-2.1.4.min.js
ajax.googleapis.com 4a356126b9573eb7bd1e9a7494737410 https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
fastly.jsdelivr.net 4a356126b9573eb7bd1e9a7494737410 https://fastly.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
cdnjs.cloudflare.com 4a356126b9573eb7bd1e9a7494737410 https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js
lib.baomitu.com 4a356126b9573eb7bd1e9a7494737410 https://lib.baomitu.com/jquery/2.1.4/jquery.min.js

结论并没啥问题

@jingjingxyk
Copy link
Contributor

@lvzhenbo
Copy link
Author

所以我觉得应该删除涉嫌修改源文件的cdn,因为这就不是cdn了

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Oct 11, 2024

所以我觉得应该删除涉嫌修改源文件的cdn,因为这就不是cdn了

@lvzhenbo 查看验证结果,并没有发现 修改源文件的事情 , 应该是用了不同时间的发版文件

公开的资源中,没发现可替代的地址

@lvzhenbo
Copy link
Author

嗯。。。我看到了jq官网少了一行这个

//# sourceMappingURL=jquery.min.map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants