Repository navigation
fix(web): stop rendering a URL-supplied message on the access-denied page - #33
Merged
Merged
Conversation
somaraj
force-pushed
the
fix/project-access-denied-message
branch
from
December 1, 2026 19:52
73391d0 to
5b287bf
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What and why
The "project access denied" page took the whole error message from the
messagequery parameter and rendered it withHtml.Raw. Anyone could send a signed-in user a link like/Common/ProjectAccessDenied?message=<script>…</script>and the markup would run on a Taskist page (reflected XSS).Now only the project name is passed (
?project=…). The page builds the message from theError.ProjectAccessDeniedtranslation and HTML-encodes the project name before inserting it. The text users see is unchanged.BaseController.ProjectAccessDenied(projectName)redirects withprojectinstead of a pre-builtmessage.CommonController.ProjectAccessDenied(project)formats the localized template with the encoded name.BacklogController.Editpassesentity.Project.Name.How it was tested
dotnet build src/Taskist.slnanddotnet test src/Taskist.slnpass./Common/ProjectAccessDenied?project=<b>x</b>shows the tags as plain text instead of rendering them.Checklist
dotnet build src/Taskist.slnanddotnet test src/Taskist.slnpasssql-scripts/03_locale.sql(n/a, uses the existingError.ProjectAccessDenied)sql-scripts/02_defaults.sql(n/a)ViewBag/ViewData, no comments in.csfiles🤖 Generated with Claude Code