Skip to content

Commit

Permalink
Prevent spoofing the author of an annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasMy committed Sep 21, 2023
1 parent 729723c commit d2ab510
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/annotations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def annotation_params
params[:annotation].delete(:id)
params[:annotation].delete(:created_at)
params[:annotation].delete(:updated_at)
# Prevent spoofing the submitter
params[:annotation][:submitted_by] = @current_user.email
params.require(:annotation).permit(:filename, :position, :line, :submitted_by,
:comment, :shared_comment, :global_comment, :value,
:problem_id, :submission_id, :coordinate)
Expand Down

0 comments on commit d2ab510

Please sign in to comment.