This repository was archived by the owner on Feb 17, 2026. It is now read-only.
fix(deps): update dependency astro to v4.16.18 [security]#428
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
fix(deps): update dependency astro to v4.16.18 [security]#428renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
7522344 to
b9d5e98
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR contains the following updates:
4.16.1→4.16.18Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2024-56140
Summary
A bug in Astro’s CSRF-protection middleware allows requests to bypass CSRF checks.
Details
When the
security.checkOriginconfiguration option is set totrue, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts)For example, with the following Astro configuration:
A request like the following would be blocked if made from a different origin:
However, a vulnerability exists that can bypass this security.
Pattern 1: Requests with a semicolon after the
Content-TypeA semicolon-delimited parameter is allowed after the type in
Content-Type.Web browsers will treat a
Content-Typesuch asapplication/x-www-form-urlencoded; abcas a simple request and will not perform preflight validation. In this case, CSRF is not blocked as expected.Pattern 2: Request without
Content-TypeheaderThe
Content-Typeheader is not required for a request. The following examples are sent without aContent-Typeheader, resulting in CSRF.Impact
Bypass CSRF protection implemented with CSRF middleware.
Note
Even with
credentials: 'include', browsers may not send cookies due to third-party cookie blocking. This feature depends on the browser version and settings, and is for privacy protection, not as a CSRF measure.CVE-2024-56159
Summary
A bug in the build process allows any unauthenticated user to read parts of the server source code.
Details
During build, along with client assets such as css and font files, the sourcemap files for the server code are moved to a publicly-accessible folder.
https://github.com/withastro/astro/blob/176fe9f113fd912f9b61e848b00bbcfecd6d5c2c/packages/astro/src/core/build/static-build.ts#L139
Any outside party can read them with an unauthorized HTTP GET request to the same server hosting the rest of the website.
While some server files are hashed, making their access obscure, the files corresponding to the file system router (those in
src/pages) are predictably named. For example. the sourcemap file forsrc/pages/index.astrogets nameddist/client/pages/index.astro.mjs.map.PoC
Here is one example of an affected open-source website:
https://creatorsgarten.org/pages/index.astro.mjs.map
The file can be saved and opened using https://evanw.github.io/source-map-visualization/ to reconstruct the source code.
The above accurately mirrors the source code as seen in the repository: https://github.com/creatorsgarten/creatorsgarten.org/blob/main/src/pages/index.astro
The above was found as the 4th result (and the first one on Astro 5.0+) when making the following search query on GitHub.com (search results link):
This vulnerability is the root cause of https://github.com/withastro/astro/issues/12703, which links to a simple stackblitz project demonstrating the vulnerability. Upon build, notice the contents of the
dist/client(referred to asconfig.build.clientin astro code) folder. All astro servers make the folder in question accessible to the public internet without any authentication. It contains.mapfiles corresponding to the code that runs on the server.Impact
All server-output (SSR) projects on Astro 5 versions v5.0.3 through v5.0.6 (inclusive), that have sourcemaps enabled, either directly or through an add-on such as sentry, are affected. The fix for server-output projects was released in astro@5.0.7.
Additionally, all static-output (SSG) projects built using Astro 4 versions 4.16.17 or older, or Astro 5 versions 5.0.7 or older, that have sourcemaps enabled are also affected. The fix for static-output projects was released in astro@5.0.8, and backported to Astro v4 in astro@4.16.18.
The immediate impact is limited to source code. Any secrets or environment variables are not exposed unless they are present verbatim in the source code.
There is no immediate loss of integrity within the the vulnerable server. However, it is possible to subsequently discover another vulnerability via the revealed source code .
There is no immediate impact to availability of the vulnerable server. However, the presence of an unsafe regular expression, for example, can quickly be exploited to subsequently compromise the availability.
Remediation
The fix for server-output projects was released in astro@5.0.7, and the fix for static-output projects was released in astro@5.0.8 and backported to Astro v4 in astro@4.16.18. Users are advised to update immediately if they are using sourcemaps or an integration that enables sourcemaps.
Release Notes
withastro/astro (astro)
v4.16.18Compare Source
Patch Changes
#12757
d0aaac3Thanks @matthewp! - Remove all assets created from the server build#12757
d0aaac3Thanks @matthewp! - Clean server sourcemaps from static outputv4.16.17Compare Source
Patch Changes
e7d14c3Thanks @ematipico! - Fixes an issue where thecheckOriginfeature wasn't correctly checking thecontent-typeheaderv4.16.16Compare Source
Patch Changes
#12542
65e50ebThanks @kadykov! - Fix JPEG image size determination#12525
cf0d8b0Thanks @ematipico! - Fixes an issue where withi18nenabled, Astro couldn't render the404.astrocomponent for non-existent routes.v4.16.15Compare Source
Patch Changes
b140a3fThanks @ematipico! - Fixes a regression where Astro was trying to accessRequest.headersv4.16.14Compare Source
Patch Changes
#12480
c3b7e7cThanks @matthewp! - Removes the default throw behavior inastro:env#12444
28dd3ceThanks @ematipico! - Fixes an issue where a server island hydration script might fail case the island ID misses from the DOM.#12476
80a9a52Thanks @florian-lefebvre! - Fixes a case where the Content Layerglob()loader would not update when renaming or deleting an entry#12418
25baa4eThanks @oliverlynch! - Fix cached image redownloading if it is the first asset#12477
46f6b38Thanks @ematipico! - Fixes an issue where the SSR build was emitting thedist/server/entry.mjsfile with an incorrect import at the top of the file/#12365
a23985bThanks @apatel369! - Fixes an issue whereAstro.currentLocalewas not correctly returning the locale for 404 and 500 pages.v4.16.13Compare Source
Patch Changes
#12436
453ec6bThanks @martrapp! - Fixes a potential null access in the clientside router#12392
0462219Thanks @apatel369! - Fixes an issue where scripts were not correctly injected during the build. The issue was triggered when there were injected routes with the sameentrypointand differentpatternv4.16.12Compare Source
Patch Changes
acac0afThanks @ematipico! - Fixes an issue where the dev server returns a 404 status code when a user middleware returns a validResponse.v4.16.11Compare Source
Patch Changes
#12305
f5f7109Thanks @florian-lefebvre! - Fixes a case where the error overlay would not escape the message#12402
823e73bThanks @ematipico! - Fixes a case where Astro allowed to call an action without usingAstro.callAction. This is now invalid, and Astro will show a proper error.#12401
9cca108Thanks @bholmesdev! - Fixes unexpected 200 status in dev server logs for action errors and redirects.v4.16.10Compare Source
Patch Changes
#12311
bf2723eThanks @dinesh-58! - Addscheckedto the list of boolean attributes.#12363
222f718Thanks @Fryuni! - Fixes code generated byastro addcommand when adding a version of an integration other than the defaultlatest.#12368
493fe43Thanks @bluwy! - Improves error logs when executing commands#12355
c4726d7Thanks @apatel369! - Improves error reporting for invalid frontmatter in MDX files during theastro buildcommand. The error message now includes the file path where the frontmatter parsing failed.v4.16.9Compare Source
Patch Changes
#12333
836cd91Thanks @imattacus! - Destroy the server response stream if async error is thrown#12358
7680349Thanks @spacedawwwg! - HonorsinlineAstroConfigparameter ingetViteConfigwhen creating a logger#12353
35795a1Thanks @hippotastic! - Fixes an issue in dev server watch file handling that could cause multiple restarts for a single file change.#12351
5751488Thanks @florian-lefebvre! - Reverts a change made in4.16.6that prevented usage ofastro:envsecrets inside middleware in SSR#12346
20e5a84Thanks @bluwy! - Fixes sourcemap generation when prefetch is enabled#12349
1fc83d3Thanks @norskeld! - Fixes thegetImageoptions type so it properly extendsImageTransformv4.16.8Compare Source
Patch Changes
#12338
9ca89b3Thanks @situ2001! - ResetsNODE_ENVto ensure install command run in dev mode#12286
9d6bcdbThanks @florian-lefebvre! - Fixes a case where a warning for experimentalastro:envsupport would be shown when using an adapter but not actually usingastro:env#12342
ffc836bThanks @liruifengv! - Fixes a typo in the command name of the CLI#12301
0cfc69dThanks @apatel369! - Fixes an issue with action handler context by passing the correct context (ActionAPIContext).#12312
5642ef9Thanks @koyopro! - Fixes an issue where usinggetViteConfig()returns incorrect and duplicate configuration#12245
1d4f6a4Thanks @bmenant! - Addcomponentsproperty to MDXInstance type definition (RenderResult and module import)#12340
94eaeeaThanks @ematipico! - Fixes an issue where Astro actions didn't work whenbasewas different from/v4.16.7Compare Source
Patch Changes
#12263
e9e8080Thanks @Fryuni! - Fixes conflict between server islands and on-demand dynamic routes in the form of/[...rest]or/[paramA]/[paramB].#12279
b781f88Thanks @jsparkdev! - Update wrong error message#12273
c2ee963Thanks @ascorbic! - Fixes an issue with some package managers where sites would not build if TypeScript was not installed.#12235
a75bc5eThanks @ematipico! - Fixes a bug where Astro Actions couldn't redirect to the correct pathname when there was a rewrite involved.#11839
ff522b9Thanks @icaliman! - Fixes error when returning a top-levelnullfrom an Astro file frontmatter#12272
388d237Thanks @ascorbic! - Correctly handles local images when using a base path in SSRv4.16.6Compare Source
Patch Changes
#11823
a3d30a6Thanks @DerTimonius! - fix: improve error message when inferSize is used in local images with the Image component#12227
8b1a641Thanks @florian-lefebvre! - Fixes a case where environment variables would not be refreshed when usingastro:env#12239
2b6daa5Thanks @ematipico! - BREAKING CHANGE to the experimental Container API onlyChanges the default page rendering behavior of Astro components in containers, and adds a new option
partial: falseto render full Astro pages as before.Previously, the Container API was rendering all Astro components as if they were full Astro pages containing
<!DOCTYPE html>by default. This was not intended, and now by default, all components will render as page partials: only the contents of the components without a page shell.To render the component as a full-fledged Astro page, pass a new option called
partial: falsetorenderToString()andrenderToResponse():v4.16.5Compare Source
Patch Changes
ff68ba5Thanks @martrapp! - Fixes an issue with cssesc in dev mode when settingvite.ssr.noExternal: truev4.16.4Compare Source
Patch Changes
#12223
79ffa5dThanks @ArmandPhilippot! - Fixes a false positive reported by the dev toolbar Audit app where a label was considered missing when associated with a buttonThe
buttonelement can be used with a label (e.g. to create a switch) and should not be reported as an accessibility issue when used as a child of alabel.#12199
c351352Thanks @ematipico! - Fixes a regression in the computation ofAstro.currentLocale#12222
fb55695Thanks @ematipico! - Fixes an issue where the edge middleware couldn't correctly compute the client IP address when callingctx.clientAddress()v4.16.3Compare Source
Patch Changes
#12220
b049359Thanks @bluwy! - Fixes accidental internalsetOnSetGetEnvparameter rename that caused runtime errors#12197
2aa2dfdThanks @ematipico! - Fix a regression where a port was incorrectly added to theAstro.urlv4.16.2Compare Source
Patch Changes
12b0022Thanks @bluwy! - Reverts #12173 which causedCan't modify immutable headerswarnings and 500 errors on Cloudflare PagesConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - "before 4am on the first day of the month" (UTC).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.