openHPI / codeharbor

Exchange of Programming Exercises acrossdiverse Code Assessment Systems through CodeHarbor
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Potential (minor) security issue when exporting using account_links #1566

Closed kkoehn closed 3 weeks ago

kkoehn commented 1 month ago

https://github.com/openHPI/codeharbor/blob/458b7f88c1aef6c09f745c5b705254c9c823ef23/app/controllers/tasks_controller.rb#L193

This looks like you can potential export the task to any account_link, since you just have to supply the id

Todo:

MrSerth commented 1 month ago

Indeed, that is a problem - I verified it manually. To fix the issue, we probably need to call authorize @account_link in all relevant places. A first check revealed the following:

To prevent any consequence of this bug for now, I took immediate action and disabled the export to any account link for now.