CONNECT WITH US
Cyber Security

Cyber Security

Critical RubyGems Flaw Could Have Let Any Gem Publisher Run Code on the Registry

The Hacker News logo

Published on

Add as a preferred source on Google
Critical RubyGems Flaw Could Have Let Any Gem Publisher Run Code on the Registry

RubyGems.org, the central registry for the Ruby community's gems, has fixed a critical flaw that let any account with a push-capable API key feed an attacker-controlled regular expression into the metadata of a gem upload.

In local testing, the registry's maintainers chained the flaw with a memory corruption bug in Ruby's regexp compiler and reached remote code execution, they said in an advisory last week. Gem users do not need to do anything.

A review of production telemetry and 29,100 gems published between October 5 and November 4 found "no direct evidence of exploitation," the advisory says. Gaps remain: logs were not kept long enough, and upload payloads were not recorded, so earlier attempts cannot be ruled out.

The flaw is tracked as GHSA-7h7w-m82c-x2xg and scores 9.0 on the CVSS scale, with no CVE assigned. It sat in how the registry reads the metadata a gem carries as YAML.

The validator that screens that metadata ignored the !ruby/regexp YAML tag, so a field carrying the tag passed schema checks as plain text. Ruby's YAML library, Psych, then turned the field into a real regular expression, compiling whatever pattern the attacker supplied.

All of this ran before the registry checked whether the account owned the gem name, so an attacker needed no gem of their own, only a push-capable API key.

9, a version affected by the seven flaws in Ruby's regexp engine and string case conversion that the Ruby project patched on November 18. The advisory does not say which memory corruption bug the chain used.


Source link

Disclaimer

We strive to uphold the highest ethical standards in all of our reporting and coverage. We TheMorningPulse.fyi want to be transparent with our readers about any potential conflicts of interest that may arise in our work. It's possible that some of the investors we feature may have connections to other businesses, including competitors or companies we write about. However, we want to assure our readers that this will not have any impact on the integrity or impartiality of our reporting. We are committed to delivering accurate, unbiased news and information to our audience, and we will continue to uphold our ethics and principles in all of our work. Thank you for your trust and support.