Repository navigation
SEC: replace polyfill.io with Cloudflare equivalent - #16629
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
There was a problem hiding this comment.
Welcome to Astropy 👋 and congratulations on your first pull request! 🎉
A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.
If you feel that this pull request has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
neutrinoceros
left a comment
There was a problem hiding this comment.
Thank you for taking care of this !
Let me ping @astropy/security-team for review
|
I think this only affected a doc example? So I'll defer to @nstarman . Thanks! |
|
We should definitely not be recommending a supply-chain attack to users 🙅 |
|
It should also be backported. Since this PR is already merged, how do we do that? It also highlights the dangers of supply-chain attacks by using any js library. While the alternative in this PR (cloudflare) is trustworthy, we should keep our attack surface small by avoiding js code that's not absolutely necessary. In this particular case, I see why MathJax is needed, but do we really need polyfill at all? |
|
Let me give it a try: @meeseeksdev backport to v6.1.x |
|
Awww, sorry neutrinoceros you do not seem to be allowed to do that, please ask a repository maintainer. |
|
I thought so. Well, now you know how to do it @hamogu :) |
|
@hamogu Adding an <script
src="https://example.com/example-framework.js"
integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
crossorigin="anonymous">
</script> |
|
@meeseeksdev backport to v6.1.x |
…629-on-v6.1.x Backport PR #16629 on branch v6.1.x (SEC: replace polyfill.io with Cloudflare equivalent)
|
@tnfssc That approach also comes with a cost: While it prevents a supply-chain attack, it increases the maintenance burden because you can't just link to the "most recent bugfix version" of any library, but any update has to be manually validated. Of course, in some sense that's the whole purpose - but we're not js experts and in many cases will pretty much have to rubber-stamp whatever update the js library does. In addition, there is a significant time-lag. Astropy is released only every 6 months or so, and older versions are in use for years after that for a typical user. If we link to the "most recent version" all those old users will get the most recent bug and security fixes on any js library we link to - if we select a fixed version, that reduced supply-chain attacks like this, but might deliver libraries dangerously out of date by the time a user uses it. |
|
@pllim I do think we can remove the link entirely as its only for compatibility with old browsers. https://docs.mathjax.org/en/latest/web/start.html#browser-compatibility |
|
I vote to just remove it then. People nowadays can probably debug old browser problem via the power of Internet anyway. |
This grew out of discussion in astropy#16629, which replaced polyfill.io calls with a safer URL, but it is even more save to reduce the attack surface and remove polyfill altogether.
This grew out of discussion in #16629, which replaced polyfill.io calls with a safer URL, but it is even more save to reduce the attack surface and remove polyfill altogether.
Description
This pull request is to address the usage of
polyfill.ioinastropy/cosmology/_io/html.pyfile. This PR replaces the domain with a Cloudflare equivalent.Source: https://blog.cloudflare.com/automatically-replacing-polyfill-io-links-with-cloudflares-mirror-for-a-safer-internet