GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — SSRF Prevention error downloading `images.contentstack.io` assets during export in CLI >= 1.46.1 · Issue #2727 · contentstack/cli Open DescriptionDescriptionContentstack CLI export/backup fails when attempting to download certain assets from The same backup pipeline and Contentstack content successfully export when using Contentstack CLI The issue occurs with both:
CLI Based on a comparison of the packages included with the working and failing CLI versions, this appears to potentially be related to a change in the asset download implementation introduced after CLI ErrorThe CLI reports an error similar to: The rejected URL is hosted on Contentstack's own An example of the URL pattern being rejected is: Some portions of the URL have been redacted. Environment
The same backup pipeline succeeds when the Contentstack CLI is downgraded to Version ComparisonContentstack CLI 1.38.0Contentstack CLI Inspection of the distributed The relevant implementation resembles: self.httpClient .options({ responseType: 'stream' }) .get(self.assetStream.url) In simplified terms, the download path appears to be: This version successfully downloads the affected assets in our Azure DevOps backup pipeline. Contentstack CLI 1.46.1Contentstack CLI Inspection of The export package now calls: this.stack .asset() .download({ url, responseType: 'stream' }) The asset URL passed to this method is prepared using: url: encodeURI(url) This is invoked through the In simplified terms, the newer download path appears to be: This is materially different from the direct HTTP GET used by the older export implementation. Suspected RegressionThe behavioral change appears to have been introduced somewhere between: and: The significant implementation difference we identified is the change from a direct HTTP asset download to: stack.asset().download() The behavior we are seeing is:
This suggests that the SSRF rejection may be associated with the newer Management SDK-based asset download path. We have not identified the exact commit that introduced the SSRF validation, so this should be considered a suspected regression based on the package implementation and observed behavior rather than a confirmed root cause. Why the SSRF Rejection Appears UnexpectedThe rejected URL is not an arbitrary external URL. It is an asset hosted on Contentstack's own image service: We therefore would not expect this URL to be rejected during a normal Contentstack stack export. Possible areas that may be worth investigating include:
The particular URL currently producing the failure contains a filename beginning with: Because of this, URL parsing or encoding differences may also be relevant, although we have not confirmed that the filename itself contributes to the SSRF rejection. Operational ImpactWe currently cannot identify a Contentstack CLI version that reliably handles both sides of our backup/restore workflow. CLI 2.0.1We need to use the newer CLI because it avoids import/restore problems encountered when using older CLI versions. However, the backup/export process encounters the SSRF prevention error when downloading certain assets. CLI 1.46.1This version also encounters the same SSRF prevention error during backup/export. CLI 1.38.0Backup/export works with this version, including downloading the affected assets. However, we have encountered other issues with the older CLI during restore/import, including what appear to be rate-limit-related failures where some content may not be restored successfully. As a result, remaining on Effectively, we currently have: This prevents us from moving the backup/restore pipeline cleanly onto the current CLI release. Expected BehaviorA Contentstack stack export should be able to download valid asset URLs hosted on: without triggering SSRF prevention. If a Contentstack-hosted asset URL genuinely fails an SSRF security check, it would also be helpful for the CLI to report the specific reason the URL was classified as unsafe. Actual BehaviorCLI CLI Reproduction SummaryAt a high level:
No Contentstack content or pipeline configuration changes are required to reproduce the difference other than changing the Contentstack CLI version. Questions for the Contentstack TeamCould the Contentstack team please confirm:
encodeURI(url) before passing the URL to: stack.asset().download() affect how certain Contentstack asset URLs are validated?
Additional InformationWe can provide the complete affected asset URL privately if required for troubleshooting, as well as additional Azure DevOps pipeline logs. We can also perform additional diagnostics against the affected asset URL if helpful, including:
The strongest indication of a regression is currently the reproducible version-dependent behavior: Combined with the change in the export package from a direct HTTP download to ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |