Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency astro to v4.16.18 [security] #520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 19, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
astro (source) 4.16.17 -> 4.16.18 age adoption passing confidence

GitHub Vulnerability Alerts

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 for src/pages/index.astro gets named dist/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):

path:astro.config.mjs @​sentry/astro

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 as config.build.client in astro code) folder. All astro servers make the folder in question accessible to the public internet without any authentication. It contains .map files 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.

  • Network attack vector.
  • Low attack complexity.
  • No privileges required.
  • No interaction required from an authorized user.
  • Scope is limited to first party. Although the source code of closed-source third-party software may also be exposed.

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.18

Compare Source

Patch Changes

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

netlify bot commented Dec 19, 2024

Deploy Preview for superfile ready!

Name Link
🔨 Latest commit 409c103
🔍 Latest deploy log https://app.netlify.com/sites/superfile/deploys/67a8b35215ea960008c524da
😎 Deploy Preview https://deploy-preview-520--superfile.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@renovate renovate bot force-pushed the renovate/npm-astro-vulnerability branch 2 times, most recently from 047810b to 4a229d0 Compare January 24, 2025 08:17
@renovate renovate bot changed the title fix(deps): update dependency astro to v4.16.18 [security] Update dependency astro to v4.16.18 [SECURITY] Jan 25, 2025
@renovate renovate bot changed the title Update dependency astro to v4.16.18 [SECURITY] fix(deps): update dependency astro to v4.16.18 [security] Jan 27, 2025
@renovate renovate bot force-pushed the renovate/npm-astro-vulnerability branch from 4a229d0 to c28c8b5 Compare January 30, 2025 14:23
@renovate renovate bot changed the title fix(deps): update dependency astro to v4.16.18 [security] Update dependency astro to v4.16.18 [SECURITY] Feb 3, 2025
@renovate renovate bot changed the title Update dependency astro to v4.16.18 [SECURITY] fix(deps): update dependency astro to v4.16.18 [security] Feb 3, 2025
Copy link
Contributor Author

renovate bot commented Feb 5, 2025

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: website/package-lock.json
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: ossified-orbit@0.0.1
npm error Found: astro@4.16.18
npm error node_modules/astro
npm error   astro@"4.16.18" from the root project
npm error
npm error Could not resolve dependency:
npm error peer astro@"^5.1.5" from @astrojs/starlight@0.31.1
npm error node_modules/@astrojs/starlight
npm error   @astrojs/starlight@"^0.31.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /tmp/renovate/cache/others/npm/_logs/2025-02-09T13_53_01_892Z-eresolve-report.txt
npm error A complete log of this run can be found in: /tmp/renovate/cache/others/npm/_logs/2025-02-09T13_53_01_892Z-debug-0.log

@renovate renovate bot force-pushed the renovate/npm-astro-vulnerability branch 2 times, most recently from 632bca6 to e042e75 Compare February 5, 2025 19:00
@renovate renovate bot force-pushed the renovate/npm-astro-vulnerability branch from e042e75 to 409c103 Compare February 9, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants