Your Yello Ring Road To Success
GOOGLE LOGIN MY ADS MY SHOP

Code Execution Bug Affects Yamale Python Package — Used by Over 200 Projects

A high-severity code injection vulnerability has been disclosed
in 23andMe’s Yamale, a schema and validator for YAML, that could be
trivially exploited by adversaries to execute arbitrary Python
code.

The flaw, tracked as CVE-2021-38305[1]
(CVSS score: 7.8), involves manipulating the schema file provided
as input to the tool to circumvent protections and achieve code
execution. Particularly, the issue[2]
resides in the schema parsing function, which allows any input
passed to be evaluated and executed, resulting in a scenario where
a specially-crafted string within the schema can be abused for the
injection of system commands.

Automatic GitHub Backups

Yamale is a Python package that allows developers to validate
YAML — a data serialization language often used for writing
configuration files — from the command line. The package is used by
at least 224 repositories[3]
on GitHub.

“This gap allows attackers that can provide an input schema file
to perform Python code injection that leads to code execution with
the privileges of the Yamale process,” JFrog Security CTO Asaf
Karas said in an emailed statement to The Hacker News. “We
recommend sanitizing any input going to eval()[4]
extensively and — preferably — replacing eval() calls with more
specific APIs required for your task.”

Following responsible disclosure, the issue has been rectified
in Yamale version 3.0.8[5]. “This release fixes a
bug where a well-formed schema file can execute arbitrary code on
the system running Yamale,” the maintainers of Yamale noted in the
release notes published on August 4.

The findings are the latest in a series of security issues
uncovered by JFrog in Python packages. In June 2021, Vdoo disclosed[6]
typosquatted packages in the PyPi repository that were found to
download and execute third-party cryptominers such as T-Rex,
ubqminer, or PhoenixMiner for mining Ethereum and Ubiq on
compromised systems.

Prevent Data Breaches

Subsequently, the JFrog security team discovered[7]
eight more malicious Python libraries, which were downloaded no
fewer than 30,000 times, that could have been leveraged to execute
remote code on the target machine, gather system information,
siphon credit card information and passwords auto-saved in Chrome
and Edge browsers, and even steal Discord authentication
tokens.

“Software package repositories are becoming a popular target for
supply chain attacks and there have been malware attacks on popular
repositories like npm[8], PyPI, and RubyGems[9],” the researchers said.
“Sometimes malware packages are allowed to be uploaded to the
package repository, giving malicious actors the opportunity to use
repositories to distribute viruses and launch successful attacks on
both developer and CI/CD machines in the pipeline.”

References

  1. ^
    CVE-2021-38305
    (nvd.nist.gov)
  2. ^
    issue
    (jfrog.com)
  3. ^
    224
    repositories
    (github.com)
  4. ^
    eval()
    (docs.python.org)
  5. ^
    Yamale
    version 3.0.8
    (github.com)
  6. ^
    disclosed
    (www.vdoo.com)
  7. ^
    discovered
    (thehackernews.com)
  8. ^
    npm
    (thehackernews.com)
  9. ^
    RubyGems
    (thehackernews.com)

Read more