Home
Forums
New posts
Search forums
What's new
New posts
New resources
New profile posts
Latest activity
Resources
Latest reviews
Search resources
Members
Current visitors
New profile posts
Search profile posts
DMCA Policy
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
FEEL FREE TO SHARE TUTORIALS, YOUR SKILS & KNOWLEDGE ON CODING, SCRIPTS, THEMES, PLUGINS OR ANY RESOURCES YOU HAVE WITH THE COMMUNITY-
Click Here To Post Your Request,
JOIN COMPUTER REPAIR FORUM
Home
Forums
WEB DEVELOPMENT CODING
Python
Python developers should be aware of a malicious code being automatically installed
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Tekera" data-source="post: 194" data-attributes="member: 88"><p>Security firm Checkmarx found that one in three software packages from PyPI contains a flaw that can lead to malicious code being automatically installed.</p><p></p><p>Many software packages from the Python Package Index (PyPi) are vulnerable to a feature that could allow an attacker to automatically execute malicious code before installation – while developers are merely downloading a package.</p><p></p><p>That’s according to researchers at cybersecurity firm Checkmarx, who said that automatic code execution is triggered upon downloading close to a third of the packages on the software repository.</p><p></p><p>“This feature is alarming due to the fact that a great deal of the malicious packages we are finding in the wild use this feature of code execution upon installation to achieve higher infection rates,” Checkmarx said in a post</p><p>published Friday (26 August).</p><p></p><p>Checkmarx, which recently also found a flaw in Amazon’s Ring camera system, is now warning Python developers that package downloading could lead to an increased risk of a supply chain attack.</p><p></p><h2><strong>What is the problem?</strong></h2><p>When a Python package is installed by a developer, PIP – Python’s package manager – tries to collect and process the metadata of the package, such as its version and the dependencies it needs to work properly.</p><p></p><p>This process occurs automatically in the background by PIP running the main setup.py script that comes as part of the package structure. The purpose of this is to provide a data structure for the package manager to understand how to handle the package.</p><p></p><p>However, according to Checkmarx, the setup.py file can contain any code the developer of the package would like, meaning that an attacker who understands this process can plant malicious code that will then execute automatically during the download.</p><p></p><p>“In fact, much of the malicious packages we are detecting contain malicious code in the ‘setup.py’ file,” Checkmarx added.</p><p></p><p>What is troubling about this flaw is the fact that it can affect developers even if they choose not to install the file, but just download it to view its code or perform a security check.</p><p></p><p>Checkmarx researchers found that simply downloading the package will run the ‘setup.py’ file and any potentially malicious code within it, which they described as “not a bug but rather a feature in the PIP design”.</p><p></p><p>This is not the first time people have raised concerns about this. Checkmarx pointed out that the issue was previously highlighted in 2014 but was never addressed.</p><p></p><h2><strong>How to work around this</strong></h2><p>Checkmarx said that there are workarounds that can help developers prevent automatic execution of code. One action is checking the package file contents before download for a .whl file.</p><p></p><p>PyPi has introduced a new wheel (.whl) file type that removes the need to run the setup.py. However, it still allows contributors to choose their preferred format for compatibility – with some choosing the more vulnerable tar.gz format, which includes the setup.py file.</p><p></p><p>“If there is a .whl file, the user can feel confident they will receive the .whl file, and no code will be executed on their machine. If there is only a tar.gz present, a user can use a safe method of download such as working directly with PyPi’s ‘simple’ API,” Checkmarx said.</p><p></p><p>Tzachi Zorenshtain, head of supply chain security at Checkmarx, told SC Media that when developers install a software package from repositories like PyPi, most are conscious of the risk of installing malicious code associated with it – and the vulnerability can’t be fixed easily.</p><p></p><p>“If we magically changed all the formats and everything is resubmitted and filed to the new format, then it would be easy to remove this behaviour. We understand that this behaviour will probably be with us for a while, so at least [building] awareness is what was important to us.”</p><p></p><p>[URL unfurl="true"]https://www.siliconrepublic.com/enterprise/python-package-security-flaw-setup-vulnerability-hack-developers[/URL]</p></blockquote><p></p>
[QUOTE="Tekera, post: 194, member: 88"] Security firm Checkmarx found that one in three software packages from PyPI contains a flaw that can lead to malicious code being automatically installed. Many software packages from the Python Package Index (PyPi) are vulnerable to a feature that could allow an attacker to automatically execute malicious code before installation – while developers are merely downloading a package. That’s according to researchers at cybersecurity firm Checkmarx, who said that automatic code execution is triggered upon downloading close to a third of the packages on the software repository. “This feature is alarming due to the fact that a great deal of the malicious packages we are finding in the wild use this feature of code execution upon installation to achieve higher infection rates,” Checkmarx said in a post published Friday (26 August). Checkmarx, which recently also found a flaw in Amazon’s Ring camera system, is now warning Python developers that package downloading could lead to an increased risk of a supply chain attack. [HEADING=1][B]What is the problem?[/B][/HEADING] When a Python package is installed by a developer, PIP – Python’s package manager – tries to collect and process the metadata of the package, such as its version and the dependencies it needs to work properly. This process occurs automatically in the background by PIP running the main setup.py script that comes as part of the package structure. The purpose of this is to provide a data structure for the package manager to understand how to handle the package. However, according to Checkmarx, the setup.py file can contain any code the developer of the package would like, meaning that an attacker who understands this process can plant malicious code that will then execute automatically during the download. “In fact, much of the malicious packages we are detecting contain malicious code in the ‘setup.py’ file,” Checkmarx added. What is troubling about this flaw is the fact that it can affect developers even if they choose not to install the file, but just download it to view its code or perform a security check. Checkmarx researchers found that simply downloading the package will run the ‘setup.py’ file and any potentially malicious code within it, which they described as “not a bug but rather a feature in the PIP design”. This is not the first time people have raised concerns about this. Checkmarx pointed out that the issue was previously highlighted in 2014 but was never addressed. [HEADING=1][B]How to work around this[/B][/HEADING] Checkmarx said that there are workarounds that can help developers prevent automatic execution of code. One action is checking the package file contents before download for a .whl file. PyPi has introduced a new wheel (.whl) file type that removes the need to run the setup.py. However, it still allows contributors to choose their preferred format for compatibility – with some choosing the more vulnerable tar.gz format, which includes the setup.py file. “If there is a .whl file, the user can feel confident they will receive the .whl file, and no code will be executed on their machine. If there is only a tar.gz present, a user can use a safe method of download such as working directly with PyPi’s ‘simple’ API,” Checkmarx said. Tzachi Zorenshtain, head of supply chain security at Checkmarx, told SC Media that when developers install a software package from repositories like PyPi, most are conscious of the risk of installing malicious code associated with it – and the vulnerability can’t be fixed easily. “If we magically changed all the formats and everything is resubmitted and filed to the new format, then it would be easy to remove this behaviour. We understand that this behaviour will probably be with us for a while, so at least [building] awareness is what was important to us.” [URL unfurl="true"]https://www.siliconrepublic.com/enterprise/python-package-security-flaw-setup-vulnerability-hack-developers[/URL] [/QUOTE]
Insert quotes…
Verification
Post reply
Richest Freecoded User
Most Freecoin
freecoded
4,876 Freecoin
J
Johnhendrick
645 Freecoin
S
Smith16
607 Freecoin
Davy200
590 Freecoin
nathan69
426 Freecoin
Laureine
415 Freecoin
A
anajeen
395 Freecoin
P
Peterparker87
331 Freecoin
C
codeguru
282 Freecoin
Tekera
267 Freecoin
Home
Forums
WEB DEVELOPMENT CODING
Python
Python developers should be aware of a malicious code being automatically installed
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top