[docs-infra] Harden the OG image edge function - #49116
Draft
Janpot wants to merge 1 commit into
Draft
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Janpot
force-pushed
the
harden-og-image-edge-function
branch
from
September 8, 2026 15:06
9ce9145 to
8ed9ec1
Compare
12 tasks
Janpot
force-pushed
the
harden-og-image-edge-function
branch
2 times, most recently
from
September 8, 2026 15:17
182eb93 to
b3923f4
Compare
Three defense-in-depth changes to the public, unauthenticated /edge-functions/og-image endpoint (all the same file, so grouped): - Pin the `og_edge` import (was an unversioned deno.land URL that resolves to latest) so an upstream release can't change a build without review. - Bound query-controlled inputs before they reach the image renderer: title/description/product length, author-list size, author name length, and GitHub username format. - Add Netlify rate limiting (100 req/min per ip+domain) so a client can't force unbounded render work by varying query parameters.
Janpot
force-pushed
the
harden-og-image-edge-function
branch
from
September 9, 2026 07:54
b3923f4 to
58bddf6
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.
Three small defense-in-depth changes to the public, unauthenticated
/edge-functions/og-imageendpoint. They all live in the same file, so they're grouped into one PR:https://deno.land/x/og_edge/mod.ts— unversioned, so a fresh build resolves to whatever is latest and an upstream release could change the incorporated code with no review here. Pinned to@0.0.6.title/description/product/authorsflowed into the image renderer with no length or complexity limits. Now capped (field lengths, author-list size, author name length, GitHub username format) before anything is rendered.