~cytrogen/gstack

ref: a0328be04c37ce4a52f6fb169b355400ecbb0ef2 gstack/test/fixtures/review-eval-vuln.rb -rw-r--r-- 406 bytes
a0328be0 — Garry Tan feat: always-on adversarial review + scope drift + plan mode design tools (v0.14.3.0) (#694) 14 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class UserController < ApplicationController
  def show
    # SQL injection — interpolating user input directly into query
    @user = User.where("id = #{params[:id]}").first
    render json: @user
  end

  def promote
    # Bypasses ActiveRecord validations — update_column skips callbacks + validation
    @user = User.find(params[:id])
    @user.update_column(:role, 'admin')
    head :ok
  end
end