fix: SEC48

Reviewed-By: timedout <git@nexy7574.co.uk>
This commit is contained in:
Jade Ellis authored and timedout committed 2026-11-30 17:59:25 +00:00
1 parent b0a829971d
commit 0af4c49657
2 files changed
+16

No files matched your search

+1
View File
@@ -0,0 +1 @@
SEC48 fix. See <https://forgejo.ellis.link/continuwuation/advisories> at a later date for more info. Contributed by @jade.
+15
View File
@@ -329,6 +329,21 @@ async fn begin_registration(
let open_registration = services.config.enable_challengeless_registration();
let mut errors = ValidationErrors::new();
// The flow is chosen by the client, so make sure it's one we actually offer
let flow_status = services.uiaa.registration_flow_status().await;
let flow_available = match form.flow {
| RequestedRegistrationFlow::Trusted =>
matches!(flow_status.trusted, TrustedFlowStatus::Available),
| RequestedRegistrationFlow::Untrusted =>
matches!(flow_status.untrusted, UntrustedFlowStatus::Available { .. }),
};
if !flow_available {
return Err(WebError::Forbidden(
"This registration flow is not available on this server".to_owned(),
));
}
let user_id = match services
.users
.determine_registration_user_id(Some(form.username), form.email.as_ref(), None)