{"id":101233,"date":"2021-09-09T10:22:51","date_gmt":"2021-09-09T08:22:51","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme"},"modified":"2021-09-09T10:22:51","modified_gmt":"2021-09-09T08:22:51","slug":"uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme","status":"publish","type":"post","link":"https:\/\/prohoster.info\/it\/blog\/news\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme","title":{"rendered":"Vulnerabilit\u00e0 in NPM che pu\u00f2 portare alla sovrascrittura dei file nel sistema","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>L'azienda GitHub ha rivelato dettagli su sette vulnerabilit\u00e0 nei pacchetti tar e @npmcli\/arborist, che offrono funzionalit\u00e0 per la gestione di archivi tar e il calcolo dell'albero delle dipendenze in Node.js. Le vulnerabilit\u00e0 consentono, durante l'estrazione di un archivio appositamente formattato, di sovrascrivere file al di fuori della directory radice in cui avviene l'estrazione, a seconda dei permessi correnti. Questi problemi permettono di eseguire codice arbitrario nel sistema, ad esempio aggiungendo comandi a ~\/ .bashrc o ~\/ .profile durante l'operazione eseguita da un utente non privilegiato o sostituendo file di sistema quando eseguiti con i privilegi di root.    <\/p>\n<p>Il pericolo delle vulnerabilit\u00e0 \u00e8 accentuato dal fatto che il codice problematico \u00e8 utilizzato nel gestore di pacchetti npm durante le operazioni con i pacchetti npm. Questo consente di organizzare un attacco agli utenti, pubblicando un pacchetto npm appositamente creato in un repository, il quale eseguir\u00e0 il codice dell'attaccante nel sistema durante la sua elaborazione. L'attacco \u00e8 possibile anche durante l'installazione dei pacchetti in modalit\u00e0 &#171;&#8212;ignore-scripts&#187;, che disabilita l'esecuzione degli script incorporati. In totale, npm \u00e8 affetto da quattro vulnerabilit\u00e0 (CVE-2021-32804, CVE-2021-37713, CVE-2021-39134 e CVE-2021-39135) su sette. Le prime due problematiche riguardano il pacchetto tar, mentre le altre due sono relative al pacchetto @npmcli\/arborist.    <\/p>\n<p>La vulnerabilit\u00e0 pi\u00f9 critica CVE-2021-32804 \u00e8 causata dal fatto che, durante la pulizia dei percorsi assoluti specificati nell'archivio tar, i caratteri ripetuti &#171;\/&#187; vengono elaborati in modo errato: viene rimosso solo il primo carattere, mentre gli altri rimangono. Ad esempio, il percorso &#171;\/home\/user\/.bashrc&#187; verr\u00e0 trasformato in &#171;home\/user\/.bashrc&#187;, mentre il percorso &#171;\/\/home\/user\/.bashrc&#187; diventa &#171;\/home\/user\/.bashrc&#187;. La seconda vulnerabilit\u00e0 CVE-2021-37713 si manifesta solo sulla piattaforma Windows ed \u00e8 legata a una pulizia errata dei percorsi relativi che includono un simbolo di unit\u00e0 non separato (&#171;C:some&#092;path&#187;) e una sequenza per tornare alla cartella precedente (&#171;C:..\/foo&#187;).     <\/p>\n<p>Le vulnerabilit\u00e0 CVE-2021-39134 e CVE-2021-39135 sono specifiche per il modulo @npmcli\/arborist. La prima problematica si manifesta solo su sistemi che non differenziano mai maiuscole e minuscole nel file system (macOS e Windows) e consente di scrivere file in parti arbitrari del file system, indicando come dipendenze due moduli &#8216;&#187;foo&#187;: &#171;file:\/some\/path&#187;&#8216; e &#8216;FOO: &#171;file:foo.tgz&#187;&#8216;, la cui elaborazione porter\u00e0 alla cancellazione del contenuto della directory \/some\/path e alla scrittura al suo interno del contenuto di foo.tgz. La seconda problematica consente di sovrascrivere file tramite manipolazioni con i link simbolici.         <\/p>\n<p>Le vulnerabilit\u00e0 sono state risolte nelle versioni Node.js 12.22.6 e 14.17.6, npm CLI 6.14.15 e 7.21.0, oltre che in versioni singole del pacchetto tar 4.4.19, 5.0.11 e 6.1.10. Dopo aver ricevuto informazioni sulla problematica nell'ambito dell'iniziativa &#171;bug bounty&#187;, GitHub ha erogato $14500 agli \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c e ha scandagliato il contenuto del repository, nel quale non sono state rilevate tentativi di sfruttamento delle vulnerabilit\u00e0. Per proteggere da questi problemi, GitHub ha anche introdotto un divieto alla pubblicazione di pacchetti NPM nei repository che includono link simbolici, link rigidi e percorsi assoluti.<br \/>\n<br \/>Fonte: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=55767\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f GitHub \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0441\u0435\u043c\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 tar \u0438 @npmcli\/arborist, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 tar-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Node.js. \u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0432\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-101233","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f GitHub \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0441\u0435\u043c\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 tar \u0438 @npmcli\/arborist, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 tar-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Node.js.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/it\/blog\/news\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"it_IT\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0432 NPM, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0430\u044f \u043a \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f GitHub \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0441\u0435\u043c\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 tar \u0438 @npmcli\/arborist, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 tar-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Node.js.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/it\/blog\/news\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-09-09T08:22:51+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-09-09T08:22:51+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Vulnerabilit\u00e0 in NPM che porta alla sovrascrittura di file sul sistema | ProHoster","description":"GitHub ha rivelato dettagli su sette vulnerabilit\u00e0 nei pacchetti tar e @npmcli\/arborist, che forniscono funzionalit\u00e0 per lavorare con archivi tar e calcolare l'albero delle dipendenze in Node.js.","canonical_url":"https:\/\/prohoster.info\/it\/blog\/news\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"it_IT","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0432 NPM, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0430\u044f \u043a \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 | ProHoster","og:description":"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f GitHub \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0441\u0435\u043c\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 tar \u0438 @npmcli\/arborist, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 tar-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Node.js.","og:url":"https:\/\/prohoster.info\/it\/blog\/news\/uyazvimost-v-npm-privodyashhaya-k-perezapisi-fajlov-v-sisteme","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2021-09-09T08:22:51+00:00","article:modified_time":"2021-09-09T08:22:51+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"101233","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-09-09 08:26:02","updated":"2022-09-27 22:52:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts\/101233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/comments?post=101233"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts\/101233\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/media?parent=101233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/categories?post=101233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/tags?post=101233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}