CVE-2013-2121: Code Injection
Eval injection vulnerability in the create method in the Bookmarks controller in Foreman before 1.2.0-RC2 allows remote authenticated users with permissions to create bookmarks to execute arbitrary code via a controller name attribute.
Other sources
Ramon de C Valle (rcvalle) reports:
There is a code injection vulnerability in the create method of the Bookmarks controller. The create method uses the (mass-assigned) controller attribute of the newly created bookmark in an eval statement without sanitizing it:
def create @bookmark = Bookmark.new(params[:bookmark])
respondto do |format| if @bookmark.save format.html { redirectto(eval(@bookmark.controller+"path"), :notice => ('Bookmark was successfully created.')) } else format.html { render :action => "new" } end end end
Any user with permissions to create a bookmark can execute arbitrary code and arbitrary system commands by sending a specially-crafted POST request. The controller attribute is validated with the regular expression /\A(\S+)\Z/, which prevents us from using code containing spaces. However, this can be easily circumvented (see example (a)). The following are some possible example attacks, including arbitrary command execution.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2013-2121?
CVE-2013-2121 has a severity rating that indicates it poses a significant risk due to potential remote code execution.
How do I fix CVE-2013-2121?
To fix CVE-2013-2121, update to Foreman version 1.2.0-RC2 or later, or apply any available security patches.
Who is affected by CVE-2013-2121?
CVE-2013-2121 affects users of Foreman versions up to 1.2.0 and Red Hat OpenStack version 3.0 who can create bookmarks.
What types of attacks are possible with CVE-2013-2121?
CVE-2013-2121 allows authenticated users to perform code injection attacks through the bookmarks feature.
Are there workarounds for CVE-2013-2121?
There are no official workarounds for CVE-2013-2121; upgrading to a secure version is recommended.