www.bleepingcomputer.com Open in urlscan Pro
104.20.59.209  Public Scan

URL: https://www.bleepingcomputer.com/news/security/popular-python-and-php-libraries-hijacked-to-steal-aws-keys/
Submission: On May 24 via api from US — Scanned from DE

Form analysis 6 forms found in the DOM

https://www.bleepingcomputer.com/search/

<form title="Search site" action="https://www.bleepingcomputer.com/search/">
  <input type="hidden" name="cx" value="partner-pub-0920899300397823:3529943228">
  <input type="hidden" name="cof" value="FORID:10">
  <input type="hidden" name="ie" value="UTF-8">
  <input type="search" name="q" aria-label="Search Site" placeholder="Search Site">
</form>

https://www.bleepingcomputer.com/search/

<form action="https://www.bleepingcomputer.com/search/">
  <input type="hidden" name="cx" value="partner-pub-0920899300397823:3529943228">
  <input type="hidden" name="cof" value="FORID:10">
  <input type="hidden" name="ie" value="UTF-8">
  <input type="search" name="q" aria-label="Search Site" placeholder="Search Site">
</form>

POST //bleepingcomputer.us10.list-manage.com/subscribe/post?u=3e2b3b692f780cdff40d45346&id=30c98e654e

<form action="//bleepingcomputer.us10.list-manage.com/subscribe/post?u=3e2b3b692f780cdff40d45346&amp;id=30c98e654e" method="post" target="_blank" novalidate="">
  <input type="email" name="EMAIL" aria-label="Enter email address" placeholder="Email Address...">
  <div style="position: absolute; left: -5000px;"><input type="hidden" aria-hidden="true" name="b_3e2b3b692f780cdff40d45346_30c98e654e" tabindex="-1" value=""></div>
  <input type="submit" value="Submit" class="bc_sub_btn">
</form>

POST //bleepingcomputer.us10.list-manage.com/subscribe/post?u=3e2b3b692f780cdff40d45346&id=30c98e654e

<form action="//bleepingcomputer.us10.list-manage.com/subscribe/post?u=3e2b3b692f780cdff40d45346&amp;id=30c98e654e" method="post" target="_blank" novalidate="">
  <input type="email" aria-label="Enter email address" name="EMAIL" placeholder="Email Address...">
  <div style="position: absolute; left: -5000px;"><input type="hidden" aria-hidden="true" name="b_3e2b3b692f780cdff40d45346_30c98e654e" tabindex="-1" value=""></div>
  <input type="submit" value="Submit" class="bc_sub_btn">
</form>

POST https://www.bleepingcomputer.com/forums/index.php?app=core&module=global&section=login&do=process&return=https://www.bleepingcomputer.com/news/security/popular-python-and-php-libraries-hijacked-to-steal-aws-keys/

<form action="https://www.bleepingcomputer.com/forums/index.php?app=core&amp;module=global&amp;section=login&amp;do=process&amp;return=https://www.bleepingcomputer.com/news/security/popular-python-and-php-libraries-hijacked-to-steal-aws-keys/"
  method="post">
  <div class="bc_form_feild">
    <label for="ips_username">Username</label>
    <input aria-label="Enter login name" title="Enter login name" type="text" id="ips_username" name="ips_username" autocomplete="username">
  </div>
  <div class="bc_form_feild">
    <label for="ips_password">Password</label>
    <input aria-label="Enter login password" title="Enter login passwod" type="password" id="ips_password" name="ips_password" autocomplete="current-password">
  </div>
  <div class="bc_form_feild">
    <div class="bc_remember">
      <input id="remember" type="checkbox" name="rememberMe" value="1" checked="checked">
      <label for="remember">Remember Me</label>
    </div>
    <div class="bc_anon">
      <input id="anonymous" type="checkbox" name="anonymous" value="1">
      <label for="anonymous">Sign in anonymously</label>
    </div>
  </div>
  <div class="bc_btn_wrap">
    <input type="hidden" name="auth_key" value="880ea6a14ea49e853634fbdc5015a024">
    <input type="submit" aria-label="Login to site" title="Login" value="Login" class="bc_sub_btn">
    <a aria-label="Sign in with Twitter" href="https://www.bleepingcomputer.com/forums/index.php?app=core&amp;module=global&amp;section=login&amp;serviceClick=twitter&amp;return=https://www.bleepingcomputer.com/news/security/popular-python-and-php-libraries-hijacked-to-steal-aws-keys/" class="bc_twitter_btn"><img src="https://www.bleepstatic.com/images/site/login/twitter.png" width="28" height="24" alt="Sign in with Twitter button"> Sign in with Twitter</a>
    <hr>
    <p>Not a member yet? <a aria-label="Register account" title="Register account" href="https://www.bleepingcomputer.com/forums/index.php?app=core&amp;module=global&amp;section=register">Register Now</a></p>
  </div>
</form>

<form>
  <input type="hidden" id="comment-id-report" value="0">
  <ul>
    <li>
      <label><input type="radio" name="comment-report-reason" value="Spam">Spam</label>
    </li>
    <li>
      <label><input type="radio" name="comment-report-reason" value="Abusive or Harmful">Abusive or Harmful</label>
    </li>
    <li>
      <label><input type="radio" name="comment-report-reason" value="Inappropriate content">Inappropriate content</label>
    </li>
    <li>
      <label><input type="radio" name="comment-report-reason" value="Strong language">Strong language</label>
    </li>
    <li>
      <label><input type="radio" name="comment-report-reason" value="Other">Other</label>
    </li>
    <li id="comment-report-other-reason-wrap" style="display:none;">
      <textarea aria-label="Enter other reason for reporting the comment" rows="2" cols="2" id="comment-report-other-reason"></textarea>
    </li>
  </ul>
  <p>Read our <a href="https://www.bleepingcomputer.com/posting-guidelines/">posting guidelinese</a> to learn what content is prohibited.</p>
</form>

Text Content

WE VALUE YOUR PRIVACY

We and our partners store and/or access information on a device, such as cookies
and process personal data, such as unique identifiers and standard information
sent by a device for personalised ads and content, ad and content measurement,
and audience insights, as well as to develop and improve products.

With your permission we and our partners may use precise geolocation data and
identification through device scanning. You may click to consent to our and our
partners’ processing as described above. Alternatively you may access more
detailed information and change your preferences before consenting or to refuse
consenting. Please note that some processing of your personal data may not
require your consent, but you have a right to object to such processing. Your
preferences will apply to this website only. You can change your preferences at
any time by returning to this site or visit our privacy policy.

MORE OPTIONSAGREE
 * 
 * 
 * 



 * 
 * 
 * 



 * News
    * Featured
    * Latest
   
    * Fake Windows exploits target infosec community with Cobalt Strike
   
    * Windows 11 hacked three more times on last day of Pwn2Own contest
   
    * Malicious PyPI package opens backdoors on Windows, Linux, and Macs
   
    * Ransomware attack exposes data of 500,000 Chicago students
   
    * Researchers to release exploit for new VMware auth bypass, patch now
   
    * Popular Python and PHP libraries hijacked to steal AWS keys
   
    * Get certified in cybersecurity with this advanced exam prep bundle
   
    * General Motors credential stuffing attack exposes car owners info

 * Downloads
    * Latest
    * Most Downloaded
   
    * Qualys BrowserCheck
   
    * STOPDecrypter
   
    * AuroraDecrypter
   
    * FilesLockerDecrypter
   
    * AdwCleaner
   
    * ComboFix
   
    * RKill
   
    * Junkware Removal Tool

 * Virus Removal Guides
    * Latest
    * Most Viewed
    * Ransomware
   
    * How to remove the PBlock+ adware browser extension
   
    * Remove the Toksearches.xyz Search Redirect
   
    * Remove the Smashapps.net Search Redirect
   
    * Remove the Smashappsearch.com Search Redirect
   
    * Remove Security Tool and SecurityTool (Uninstall Guide)
   
    * How to remove Antivirus 2009 (Uninstall Instructions)
   
    * How to Remove WinFixer / Virtumonde / Msevents / Trojan.vundo
   
    * How to remove Google Redirects or the TDSS, TDL3, or Alureon rootkit using
      TDSSKiller
   
    * Locky Ransomware Information, Help Guide, and FAQ
   
    * CryptoLocker Ransomware Information Guide and FAQ
   
    * CryptorBit and HowDecrypt Information Guide and FAQ
   
    * CryptoDefense and How_Decrypt Ransomware Information Guide and FAQ

 * Tutorials
    * Latest
    * Popular
   
    * How to make the Start menu full screen in Windows 10
   
    * How to install the Microsoft Visual C++ 2015 Runtime
   
    * How to open an elevated PowerShell Admin prompt in Windows 10
   
    * How to Translate a Web Page in Google Chrome
   
    * How to start Windows in Safe Mode
   
    * How to remove a Trojan, Virus, Worm, or other Malware
   
    * How to show hidden files in Windows 7
   
    * How to see hidden files in Windows

 * Deals
    * Categories
   
    * eLearning
   
    * IT Certification Courses
   
    * Gear + Gadgets
   
    * Security

 * Forums
 * More
   * Startup Database
   * Uninstall Database
   * File Database
   * Glossary
   * Chat on Discord
   * Send us a Tip!
   * Welcome Guide


 * Home
 * News
 * Security
 * Popular Python and PHP libraries hijacked to steal AWS keys

 * AddThis Sharing Buttons
   Share to FacebookFacebookShare to TwitterTwitterShare to
   LinkedInLinkedInShare to RedditRedditShare to Hacker NewsHacker NewsShare to
   EmailEmail
 *  


POPULAR PYTHON AND PHP LIBRARIES HIJACKED TO STEAL AWS KEYS

By

AX SHARMA

 * May 24, 2022
 * 07:42 AM
 * 0

PyPI module 'ctx' that gets downloaded over 20,000 times a week has been
compromised in a software supply chain attack with malicious versions stealing
the developer's environment variables.

The threat actor even replaced the older, safe versions of 'ctx' with code that
exfiltrates the developer's environment variables, to collect secrets like
Amazon AWS keys and credentials.

Additionally, versions of a 'phpass' fork published to the PHP/Composer package
repository Packagist had been altered to steal secrets in a similar fashion.

PLAY Top Articles Video Settings Full Screen About Connatix V163604 Read More
Read More Read More Read More Read More Read More Popular PyPI and PHP libraries
hijacked to stealAWS keys 1/1 Skip Ad Continue watching after the ad Visit
Advertiser websiteGO TO PAGE



PHPass framework has incurred over 2.5 million downloads on the Packagist
repository over its lifetime—although the downloads for malicious versions are
believed to be far more limited.


PYTHON LIBRARY 'CTX' UPLOADS SECRETS TO A HEROKU ENDPOINT

Heavily downloaded PyPI package 'ctx' has been compromised sometime this
month with newly published versions exfiltrating your environment variables to
an external server.

'ctx' is a minimal Python module that lets developers manipulate their
dictionary ('dict') objects in a variety of ways. The package, although popular,
had not been touched since 2014 by its developer, as seen by BleepingComputer.
However, newer versions emerged starting May 15th into this week and contained
malicious code:

PyPI package 'ctx' republished after years of inactivity (BleepingComputer)

A Reddit user jimtk first took notice of the compromised 'ctx' package.

Ethical hacker Somdev Sangwan further reported PHP package 'phpass' having been
compromised with the tainted versions of the library stealing developer's AWS
secret keys:



These claims were vetted by the Sonatype security research team that I am a part
of.

Although PyPI has taken down the malicious 'ctx' versions as of a few hours ago,
copies retrieved from Sonatype's malware archives show presence of malicious
code within all 'ctx' versions. Of note is, the 0.1.2 version that hadn't been
touched since 2014 was also replaced this week with malicious payload:

Malicious code within 'ctx' (BleepingComputer)

Once installed, these versions gather all your environment variables and
upload these values to the following Heroku endpoint:

https://anti-theft-web.herokuapp[.]com/hacked/

At the time of our analysis, the endpoint was no longer active.


PHP PACKAGE 'PHPASS' ALTERED TO STEAL AWS CREDENTIALS

In an identical attack, the fork of an immensely popular Composer/PHP package,
'hautelook/phpass' was compromised with malicious versions published to the
Packagist repository.

PHPass is an open source password hashing framework that can be used by
developers in PHP applications. Released in 2005, the framework has been
downloaded over 2.5 million times on Packagist over its lifetime.

BleepingCompuer also observed malicious commits made to the PHPass project this
week that steal environment variables in a similar fashion.

Within PHPass, the altered 'PasswordHash.php' file specifically looks for
the 'AWS_ACCESS_KEY' and 'AWS_SECRET_KEY' values in your environment. These
secrets are then uploaded to the same Heroku endpoint.

Malicious commits made to PHPass (BleepingComputer)

The presence of identical logic and Heroku endpoints within the PyPI and PHP
packages indicate a common threat actor being responsible for both of these
hijacks.

Researchers claim the attacker's identity is obvious. However, this could've
been a PoC exercise gone wrong and until more information comes to light, it
would be irresponsible to name the person behind 'ctx' and 'phpass' hijack just
yet.

Also, while the malicious PyPI package 'ctx' was live until later today, the
impact from malicious 'PHPass' versions appears to have been far more limited
after Packagist's co-founder Jordi Boggiano marked the hijacked repository as
"abandoned" and pointed everyone to use bordoni/phpass instead:



It is purported that a maintainer account compromise led to the hijacking of
PyPI package 'ctx' but we are yet to find out the real cause.

But, the compromise of hautepass/phpass has been attributed to the attacker
claiming a previously abandoned GitHub repository and reviving that repository
to publish altered 'phpass' versions to the Packagist registry.

This type of attack has earlier been called repo jacking by cybersecurity firm
Security Innovation. More recently, Intezer and Checkmarx released a joint
report building on this research and how it could impact Go projects, dubbing
the attack "chainjacking."

This hijacking incident follows our recent report of a PyPI typosquat that was
caught launching backdoors on Windows, Linux, and Macs.

Earlier this year, vastly popular npm libraries, ua-parser-js, 'coa' and 'rc'
had been hijacked to serve crypto miners and credential stealers.

Following these attacks, GitHub mandated two-factor authentication for
maintainers of Top 100 npm packages, and announced additional security
enhancements.

The ongoing trend of threat actors and bug bounty hunters finding novel tactics
to infiltrate the software supply chain could very well prompt administrators
of other software registries to introduce similar enhancements.

 

h/t Ilkka Turunen for the tip off.


RELATED ARTICLES:

Open source 'Package Analysis' tool finds malicious npm, PyPI packages

Malicious PyPI package opens backdoors on Windows, Linux, and Macs

Check your gems: RubyGems fixes unauthorized package takeover bug

NPM flaw let attackers add anyone as maintainer to malicious packages

Third npm protestware: 'event-source-polyfill' calls Russia out


 * Compromise
 * Malware
 * PHP
 * PyPI
 * Python
 * Supply Chain
 * Supply-Chain Attack

 * Facebook
 * Twitter
 * LinkedIn

 * Email
 * 



AX SHARMA

Ax Sharma is a Security Researcher and Tech Reporter. His works and expert
analyses have frequently been featured by leading media outlets including
Fortune, Business Insider, The Register, TechRepublic, etc. Ax's expertise lies
in vulnerability research, malware analysis, and open source software. He's an
active community member of the OWASP Foundation, Open Source Security Foundation
(OpenSSF), and the British Association of Journalists (BAJ). Send any tips via
email or Twitter DM.
 * Previous Article
 * Next Article

POST A COMMENT COMMUNITY RULES

YOU NEED TO LOGIN IN ORDER TO POST A COMMENT

Not a member yet? Register Now


YOU MAY ALSO LIKE:

Popular Stories

 * PDF smuggles Microsoft Word doc to drop Snake Keylogger malware

 * Google: Predator spyware infected Android devices using zero-days



NEWSLETTER SIGN UP

To receive periodic updates and news from BleepingComputer, please use the form
below.





NEWSLETTER SIGN UP


 * Follow us:
 * 
 * 
 * 
 * 

MAIN SECTIONS

 * News
 * Downloads
 * Virus Removal Guides
 * Tutorials
 * Startup Database
 * Uninstall Database
 * File Database
 * Glossary

COMMUNITY

 * Forums
 * Forum Rules
 * Chat

USEFUL RESOURCES

 * Welcome Guide
 * Sitemap

COMPANY

 * About BleepingComputer
 * Contact Us
 * Send us a Tip!
 * Advertising
 * Write for BleepingComputer
 * Social & Feeds
 * Changelog

Terms of Use - Privacy Policy - Ethics Statement

Copyright @ 2003 - 2022 Bleeping Computer® LLC - All Rights Reserved



LOGIN

Username
Password
Remember Me
Sign in anonymously
Sign in with Twitter

--------------------------------------------------------------------------------

Not a member yet? Register Now

REPORTER

HELP US UNDERSTAND THE PROBLEM. WHAT IS GOING ON WITH THIS COMMENT?

 * Spam
 * Abusive or Harmful
 * Inappropriate content
 * Strong language
 * Other
 * 

Read our posting guidelinese to learn what content is prohibited.

Submitting...
SUBMIT