{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/crates.io/issues/75","labels_url":"https://api.github.com/repos/rust-lang/crates.io/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/crates.io/issues/75/comments","events_url":"https://api.github.com/repos/rust-lang/crates.io/issues/75/events","html_url":"https://github.com/rust-lang/crates.io/issues/75","id":49847799,"number":75,"title":"Security model / TUF","user":{"login":"tarcieri","id":797,"avatar_url":"https://avatars.githubusercontent.com/u/797?v=3","gravatar_id":"","url":"https://api.github.com/users/tarcieri","html_url":"https://github.com/tarcieri","followers_url":"https://api.github.com/users/tarcieri/followers","following_url":"https://api.github.com/users/tarcieri/following{/other_user}","gists_url":"https://api.github.com/users/tarcieri/gists{/gist_id}","starred_url":"https://api.github.com/users/tarcieri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarcieri/subscriptions","organizations_url":"https://api.github.com/users/tarcieri/orgs","repos_url":"https://api.github.com/users/tarcieri/repos","events_url":"https://api.github.com/users/tarcieri/events{/privacy}","received_events_url":"https://api.github.com/users/tarcieri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/crates.io/labels/infrastructure","name":"infrastructure","color":"000000"}],"state":"open","locked":false,"assignee":{"login":"edunham","id":812892,"avatar_url":"https://avatars.githubusercontent.com/u/812892?v=3","gravatar_id":"","url":"https://api.github.com/users/edunham","html_url":"https://github.com/edunham","followers_url":"https://api.github.com/users/edunham/followers","following_url":"https://api.github.com/users/edunham/following{/other_user}","gists_url":"https://api.github.com/users/edunham/gists{/gist_id}","starred_url":"https://api.github.com/users/edunham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edunham/subscriptions","organizations_url":"https://api.github.com/users/edunham/orgs","repos_url":"https://api.github.com/users/edunham/repos","events_url":"https://api.github.com/users/edunham/events{/privacy}","received_events_url":"https://api.github.com/users/edunham/received_events","type":"User","site_admin":false},"milestone":null,"comments":27,"created_at":"2014-11-24T01:02:29Z","updated_at":"2016-01-19T07:22:00Z","closed_at":null,"body":"The fun thing about packaging systems with central package directories is the central package directories have this annoying tendency to be compromised. There have been a few such notable compromises in recent history, such as RubyGems and npm. Fortunately no serious problems resulted in either of these attacks they were both detected early, but a more sinister attack could go undetected, poisoning the package repository and spreading malware.\r\n\r\nOne way to stop this is to move the source of authority for the integrity of packages from the package repository to the developers of packages. However, managing keys is hard, and many people simply won't want to do this. Furthermore, you have to worry about how to retrofit the existing packages into this model if your packaging system didn't launch with developer-managed keys from day one (which Cargo didn't)\r\n\r\nThere's a system that solves all these problems called The Update Framework (TUF), collaboratively developed by both Tor developers and academics:\r\n\r\nhttp://theupdateframework.com/\r\n\r\nThe Update Framework allows developers to opt-in to managing their own keys. High profile packages can be signed by developers: specifically, TUF supports \"threshold signatures\" so k / n developers are needed to countersign a package in order for it to count as released. However, not everyone is forced to manage their own keys: people who don't want to can have their packages signed by the package repository instead.\r\n\r\nTUF secures developer keys by having developers who own \"unclaimed\" packages request to associate some signing keys with them. A system administrator then periodically (once a week or other tolerable time interval) signs these developer keys with an offline key (or keys, TUF uses threshold signatures everywhere). At this point, these packages move from \"unclaimed\" to \"claimed\", and become what TUF calls a \"delegated target\": the developers, not the packaging system, become the source of truth for that particular package.\r\n\r\nFor more information, I suggest you read their paper \"Survivable Key Compromise In Software Update Systems\":\r\n\r\nhttp://freehaven.net/~arma/tuf-ccs2010.pdf\r\n\r\nI think a system like TUF can easily be retrofitted to Cargo as it exists today. There are a few changes I might recommend before you try to add TUF, but I think you're off to a good start.\r\n\r\nHowever, if you did want to use something like TUF, it does figure into the overall AuthZ model of the system. There are a number of outstanding AuthZ issues / suggestions like #48 and #58. If you do want to integrate a system like TUF where developers manage their own keys, it will definitely influence whatever AuthZ model you adopt, because TUF moves things like authorization and integrity partly to the client.\r\n\r\nI worked on adding TUF to RubyGems at one point and liked it, although we never finished. The people behind it worked on adding it to PyPI, and were very helpful with our efforts to add it to RubyGems."},"comment":{"url":"https://api.github.com/repos/rust-lang/crates.io/issues/comments/172762253","html_url":"https://github.com/rust-lang/crates.io/issues/75#issuecomment-172762253","issue_url":"https://api.github.com/repos/rust-lang/crates.io/issues/75","id":172762253,"user":{"login":"faern","id":332294,"avatar_url":"https://avatars.githubusercontent.com/u/332294?v=3","gravatar_id":"","url":"https://api.github.com/users/faern","html_url":"https://github.com/faern","followers_url":"https://api.github.com/users/faern/followers","following_url":"https://api.github.com/users/faern/following{/other_user}","gists_url":"https://api.github.com/users/faern/gists{/gist_id}","starred_url":"https://api.github.com/users/faern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faern/subscriptions","organizations_url":"https://api.github.com/users/faern/orgs","repos_url":"https://api.github.com/users/faern/repos","events_url":"https://api.github.com/users/faern/events{/privacy}","received_events_url":"https://api.github.com/users/faern/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T07:22:00Z","updated_at":"2016-01-19T07:22:00Z","body":"The number of bits alone doesn't determine the security of the hash function, the algorithm used to calculate them does. From every source I can find the security community agrees that SHA1 *is* broken, here are just two examples:\r\nhttps://www.schneier.com/blog/archives/2005/02/sha1_broken.html\r\nhttp://arstechnica.com/security/2015/10/sha1-crypto-algorithm-securing-internet-could-break-by-years-end/\r\n"}}