CVE-2014-125054 (published 2023-01-07T09:15Z)

A vulnerability classified as critical was found in koroket RedditOnRails. This vulnerability affects unknown code of the component Vote Handler. The manipulation leads to improper access controls. The attack can be initiated remotely. The patch is identified as 7f3c7407d95d532fcc342b00d68d0ea09ca71030. It is recommended to apply a patch to fix this issue. VDB-217594 is the identifier assigned to this vulnerability.

CVSS v3 base score: 4.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N)

Weakness information:
cwe_id: CWE-284
cwe_name: Improper Access Control
description: The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
extended_description: 
            Access control involves the use of several protection mechanisms such as:
            
               Authentication (proving the identity of an actor)
               Authorization (ensuring that a given actor can access a resource), and
               Accountability (tracking of activities that were performed)
            
            When any mechanism is not applied or otherwise fails, attackers can compromise the security of the product by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
            There are two distinct behaviors that can introduce access control weaknesses:
               
                  Specification: incorrect privileges, permissions, ownership, etc. are explicitly specified for either the user or the resource (for example, setting a password file to be world-writable, or giving administrator capabilities to a guest user). This action could be performed by the program or the administrator.
                  Enforcement: the mechanism contains errors that prevent it from properly enforcing the specified access control requirements (e.g., allowing the user to specify their own privileges, or allowing a syntactically-incorrect ACL to produce insecure settings). This problem occurs within the program itself, in that it does not actually enforce the intended security policy that the administrator specifies.
               
         
		 

Fix information:
repo_url: https://github.com/koroket/RedditOnRails
commit_details: repo_url: https://github.com/koroket/RedditOnRails
author: Jordan Arnesen
author_date: 2014-12-19 17:11:20-08:00
msg: Solved duplicate votes issue; Discovered karma exploitation
Exploit - Currently even if you already upvoted you can click the upvote button again, which doesn't add a new vote to the post/comment but *does* add more to the user's karma since there's no check for existing vote value to only add karma for actual changes to votes
repository: repo_url: https://github.com/koroket/RedditOnRails
repo_name: koroket/RedditOnRails
description: Reddit-on-Rails
repo_language: Ruby
owner: koroket
file_changes: filename: comments_controller.rb
change_type: ModificationType.MODIFY
diff: @@ -94,6 +94,6 @@ class CommentsController < ApplicationController
     end
 
     def current_user_existing_vote
-      @vote = current_user.votes.find_by(comment_id: params[:id])
+      @vote = current_user.votes.find_by(votable_id: params[:id])
     end
 end

programming_language: Ruby
filename: posts_controller.rb
change_type: ModificationType.MODIFY
diff: @@ -111,6 +111,7 @@ class PostsController < ApplicationController
     end
 
     def current_user_existing_vote
-      @vote = current_user.votes.find_by(post_id: params[:id])
+      # @vote = current_user.votes.find_by(post_id: params[:id])
+      @vote = current_user.votes.find_by(votable_id: params[:id])
     end
 end

programming_language: Ruby