Skip to content

Evaluator Rewrite + Docker#822

Draft
JersyJ wants to merge 5 commits intomrlvsb:masterfrom
JersyJ:evaluator-rewrite
Draft

Evaluator Rewrite + Docker#822
JersyJ wants to merge 5 commits intomrlvsb:masterfrom
JersyJ:evaluator-rewrite

Conversation

@JersyJ
Copy link
Contributor

@JersyJ JersyJ commented Feb 2, 2026

No description provided.

…oints to host-side type handlers, adding `bleach` for output sanitization.
…dding new language-specific pipe types with their configuration
…uild process with enhanced output formatting
@Firestone82
Copy link
Contributor

Firestone82 commented Feb 3, 2026

Aaah, I thought someone had actually balls to rewrite evaluation code inside kelvin. And this is just docker stuff :D 🥲

@JersyJ
Copy link
Contributor Author

JersyJ commented Feb 3, 2026

Aaah, I thought someone had actually balls to rewrite evaluation code inside kelvin. And this is just docker stuff :D 🥲

This isn't just Docker stuff, check type_handlers.py 😅

@Firestone82
Copy link
Contributor

Aaah, I thought someone had actually balls to rewrite evaluation code inside kelvin. And this is just docker stuff :D 🥲

This isn't just Docker stuff, check type_handlers.py 😅

I see, it was hidden as there was many lines.

if len(executables) == 0:
raise BuildError("No executable has been built.", logs=html_output)
elif len(executables) > 1:
raise BuildError(f"Multiple executables have been built: {','.join(executables)}", logs=html_output)
Copy link
Contributor

@Jan1s2 Jan1s2 Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not yet go through the entirety of this, but from what I can tell, this leads to XSS if a student can set the filename of the executables (for example with the <img src=x trick) because neither this raise, nor the catch sanitizes the executable names. When I attempted it on my machine (after removing non-buildable images like dotnet - an && seems to be missing there between apt-get install and apt-get clean - and adding support for make to gcc image, because the make executable was missing from the image and due to the presence of cmake support, I doubt this is intentional), this XSS worked. It does not work on master branch, because there gcc's entry.py contains a bleach.clean(str(e)) in the except.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not yet go through the entirety of this, but from what I can tell, this leads to XSS if a student can set the filename of the executables (for example with the <img src=x trick) because neither this raise, nor the catch sanitizes the executable names. When I attempted it on my machine (after removing non-buildable images like dotnet - an && seems to be missing there between apt-get install and apt-get clean - and adding support for make to gcc image, because the make executable was missing from the image and due to the presence of cmake support, I doubt this is intentional), this XSS worked. It does not work on master branch, because there gcc's entry.py contains a bleach.clean(str(e)) in the except.

Hi, thanks for the early review. To be honest, I haven’t started testing the code yet and this is just an early scratch, which is why it’s still in draft. I mainly wanted an estimate of how much I’ve changed so far.

Your point definitely makes sense. I need to re-check and sanitize everything that is input/output. Btw, I’m planning to replace bleach with nh3, since bleach was discontinued in 2023. I’ll definitely ask for your review again, if you’re okay with that, once this is ready (it will probably be split into three PRs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants