Repository navigation
2.0.2-alpha - Develop - #22
Open
ReneSchwarzer wants to merge 16 commits into
Open
ReneSchwarzer wants to merge 16 commits into
ReneSchwarzer wants to merge 16 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IdentityValidationContext carries the token id, the token expiration and the grant expiration, read in Confirm from the token that was verified. On a refresh the request still carries the previous access cookie, which nobody verified; a validator reading its claims from there could be handed a forged grant end and keep a revoked session alive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The console writer ran on the thread pool and read from a channel, which resumes a waiting reader through the pool as well. With the pool saturated nothing was written and every Close waited out its five seconds. A blocking collection drained by a dedicated thread needs no pool thread at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le output Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- read Content-Encoding as a content coding, not a charset: a compressed body no longer fails the context with a 500 - resolve the request target below the request's authority, so "//host/x" cannot replace the host and steer the routing past a proxy's path rule - build the websocket uri from the host header port, not the listener port - parse the query in order, so a repeated key always takes its last value - map unknown methods to NONE and answer them with 501 instead of running the GET handler; accept websockets over HTTP/2 and HTTP/3 extended CONNECT - challenge 401s with Bearer instead of Basic, which made browsers prompt and then shadow the sign-in cookie with typed credentials - refuse an upgrade to an endpoint that is no socket with a 400, write the handshake headers only for an upgradable request and take them back on failure, and send no http status once the connection is switched - read the request body asynchronously in the pipeline, also without a Content-Length; an oversized or malformed body is answered with 413/400 - enforce MaxMessageSize on sockets with close code 1009 and drop the never thrown SocketMessageTooLargeException - match the status page application by whole segments, longest route first - render the 500 page for a failed context as a single document - number requests atomically and log the done line with the same number - keep colons in Basic passwords and unquote a quoted multipart boundary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…istry The compiled render delegate captured the fragment instance of the first request (Expression.Constant) and was cached per class, so every later request rendered on that foreign instance: state leaked across requests and users, concurrent requests rendered on one object, and the instance was never released. The delegate now takes the instance as an argument (typed Func, no DynamicInvoke); a [Cache] fragment keeps one instance, created race-free and disposed with its item. FragmentDictionary is now guarded by a lock and returns materialized lists: the package scan writes it while requests read it. RemoveFragments read the removed items lazily after removing them, so RemoveFragment never fired; it now collects them first, and the manager disposes them. GetFragments(app, section, IEnumerable<Type>) called itself with the same arguments - an infinite recursion that overflowed the stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package scan adds and removes plugins on its own thread while requests read the registries; plain dictionaries written during a read can throw or loop forever. Page, include, theme, application, event, job, task and identity registries now take every access under a lock and hand out copies, so handlers, renders and access checks run outside it. Removal was broken in several places: PageDictionary read the removed pages lazily after removing them (no Dispose, no RemovePage, so endpoint listeners kept dead pages), StatusPageManager dropped a plugin without announcing or disposing its pages, EventManager.Remove(plugin) raised no event, and an event handler without [Event] ended the registration of every handler after it (break instead of continue). The job scheduler ended for the whole process on the first exception in a minute's update; it now logs it and schedules the next minute. Tasks created concurrently threw on the second insert; ids now compare ordinally ignoring case (ConcurrentDictionary) instead of the culture-dependent ToLower, and the access check compares policy names ordinally instead of CurrentCultureIgnoreCase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three setting registries share one locked base (SettingItemRegistry) that hands out copies and returns what it removes. Removing a plugin dropped its setting pages without announcing them, so the endpoint registration kept their routes, and categories and groups were never removed at all; the manager now empties all three and raises RemoveSettingPage for every page. A cached setting page instance is created outside the lock and kept race-free. Plugin and component registries are concurrent dictionaries; the component list of a plugin is published as a new copy after each addition instead of being grown in place while requests may enumerate it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HTML reaches the parser from users (editor content, comments, the HTML to Markdown conversion). The parser recursed once per start tag, so a few hundred kilobytes of nested tags overflowed the stack and ended the server process. It now keeps an explicit stack of open elements; elements opened deeper than MaxNestingDepth (256) stay empty and their content becomes their siblings, which also bounds every renderer recursing through the tree. End tags follow the browser: one closes the innermost open element of its name and everything opened inside it, a stray one is ignored - it used to stop the parse and drop the rest of the document. The doctype check compared in place instead of searching the rest of the input on every "<!", which was quadratic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a browser BREAKING CHANGE: HtmlText now HTML-encodes its value (&, <, >). It used to be written verbatim and left the encoding to more than a hundred callers; any that forgot turned user input into script. Markup a caller trusts goes through HtmlRaw. An element holding only text took a shortcut that appended the combined values raw; it encodes them as well. The page title (</title> in a record name) and the HTML comment text (a "--" could end the comment) are encoded too. BREAKING CHANGE: a StatusMessage is plain text. Every response writes it through StatusMessage.ToHtml, encoded with its line breaks kept; HttpServer describes exceptions as text instead of an HTML fragment and its built-in status page encodes the message. The parser stores text decoded (so a document round-trips with its entities), keeps the content of raw text elements raw, and drops elements and attributes whose names could not be written back safely; the writer refuses such attribute names as well. The tokenizer treats only the five HTML whitespace characters as separators - U+00A0 split "<img src=x onerror=...>", one inert element to a browser, into an image with an event handler - and ends comments at "--!>", "<!-->" and "<!--->" like a browser, so markup the browser renders can no longer hide in a comment from whatever reads the parsed tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User HTML (Markdown inline HTML, editor content, comments) needs one place that reduces it to markup that cannot run script: allowlisted elements and attributes, removed script/style/iframe/svg/form content, links and images checked by scheme allowlist (whitespace/control characters inside the scheme ignored like a browser does), inline styles reduced to harmless declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ypes
The file name and content type of a multipart upload were taken from the
client as sent. An application storing a file under its declared name wrote
wherever "../" or an absolute path pointed. The name is now the last segment
after either separator, without control characters, reserved characters and
leading dots or spaces, at most 255 characters ("file" when nothing remains);
a content type is kept only in the form type/subtype, otherwise it reads as
application/octet-stream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d public BREAKING CHANGE: an endpoint without a policy was served to anybody, so every page, REST API, resource or socket that forgot its policy was public - in WebApp this applied to every REST base class and to the message queue socket. Every request is now checked: an endpoint without a policy requires a signed-in caller. Public endpoints say so with [Policy<PublicAccessPolicy>] or by implementing IPublicEndpoint, which is inherited by derived classes. PublicAccessPolicy grants everybody (it was defined but denied anonymous callers), a policy that could not be created denies, and assets stay public. WebExpress:Security:PublicByDefault restores the old behaviour for a migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s host Left without a bearer token, an enabled /metrics endpoint answered anybody who could reach the server - load, login failures and the framework version. Without a token it now answers only a direct loopback request without an X-Forwarded-For header, a scraper on the same host; every other caller is refused with 401. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ring.Format A key without a translation is returned as it stands and became the format of string.Format; keys are often built from data, so a brace in a stored status or a user-chosen name threw a FormatException and failed the request. Such a text is now returned unformatted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
No description provided.