Skip to content

Commit 3a80326

Browse files
committed
whitelist create and deleted at
1 parent 6517f9b commit 3a80326

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/controllers/api/admin/v1/admin_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ def execute
257257
return render json: { error: "no perms lmaooo" }, status: :forbidden
258258
end
259259

260+
cool = %w[created_at deleted_at]
261+
if query.upcase.match?(/\b(#{not_cool.join('|')})\b/) && !query.upcase.match?(/\b(#{cool.join('|')})\b/)
262+
return render json: { error: "no perms lmaooo" }, status: :forbidden
263+
end
264+
260265
begin
261266
limited_query = query.strip
262267
unless limited_query.upcase.include?("LIMIT")

0 commit comments

Comments
 (0)