VNOI-Admin / OJ

A modern open-source online judge and contest platform system.
https://oj.vnoi.info
GNU Affero General Public License v3.0
153 stars 67 forks source link

Fix JudgeHandler to void leaking submission result via event server #349

Closed hieplpvip closed 10 months ago

hieplpvip commented 10 months ago

Description

Type of change: bug fix

What

The following messages are broadcasted when a submission is being graded:

image

Hence, these messages can be used to leak the number of test cases and time/memory usage even when testcase result visibility is set to "Show submission result only".

This PR fixes it by removing all additional information (they are not used at all) and not broadcasting test-case messages if testcase result visibility is not "Show all testcase result".

Note that this change applies to everyone because the event server does not have a notion of permissions. While superusers can view the full test case result, they no longer get live updates for each test case.

How Has This Been Tested?

Tested locally

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.