mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
fix broken validation
This commit is contained in:
@@ -248,8 +248,11 @@ module Api
|
||||
return render json: { error: "whatcha doin'?" }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
cool = %w[created_at deleted_at]
|
||||
not_cool = %w[INSERT UPDATE DELETE DROP CREATE ALTER TRUNCATE EXEC EXECUTE]
|
||||
if not_cool.any? { |keyword| query.upcase.include?(keyword) }
|
||||
|
||||
if not_cool.any? { |keyword| query.upcase.include?(keyword) } &&
|
||||
cool.none? { |field| query.upcase.include?(field.upcase) }
|
||||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
@@ -257,11 +260,6 @@ module Api
|
||||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
cool = %w[created_at deleted_at]
|
||||
if query.upcase.match?(/\b(#{not_cool.join('|')})\b/) && !query.upcase.match?(/\b(#{cool.join('|')})\b/)
|
||||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
begin
|
||||
limited_query = query.strip
|
||||
unless limited_query.upcase.include?("LIMIT")
|
||||
|
||||
Reference in New Issue
Block a user