Files
wehub-resource-sync dfb0b33892
Workflow Lint / actionlint (push) Has been cancelled
Build CI Image / build (push) Has been cancelled
Skill Docs Freshness / check-freshness (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:59:46 +08:00

15 lines
406 B
Ruby

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