Skip to content

Bugfix/snyk sla CVE fixes - #1159

Merged
vikrantraut-cstk merged 377 commits into
bugfix/setup-env-and-win-buildfrom
bugfix/snyk-sla-cve-fixes
Dec 1, 2026
Merged

vikrantraut-cstk merged 377 commits into
bugfix/setup-env-and-win-buildfrom
bugfix/snyk-sla-cve-fixes

Conversation

@vikrantraut-cstk

Copy link
Copy Markdown
Contributor

🔗 Jira Ticket

Replace with your ticket link — required before requesting review.

MIGRATION-XXXX


📋 PR Type

  • ✨ Feature
  • 🐛 Bug Fix
  • 🔥 Hotfix
  • ♻️ Refactor
  • 🧹 Chore / Dependency Update
  • 📝 Documentation

📝 Description

What changed?

Why?


🧩 Affected Areas

  • api — Node.js backend
  • ui — React frontend
  • upload-api — Upload API server
  • docker / docker-compose
  • CI / GitHub Actions workflows
  • Environment variables / config
  • Other:

🧪 How to Test

Expected result:


📸 Screenshots / Recordings

Before After

🔗 Related PRs / Dependencies


✅ Author Checklist

Complete this before moving the PR out of Draft.

  • Branch follows naming convention: feature/, bugfix/, or hotfix/ + 5–30 lowercase chars
  • Jira ticket linked above
  • Self-reviewed the diff — no debug logs, commented-out code, or TODOs left in
  • .env / example.env updated if new environment variables were added
  • No sensitive credentials or secrets committed
  • Existing tests pass locally (npm test)
  • New tests written (or not applicable — explain why)
  • README.md / docs updated if behaviour changed
  • Talisman pre-push scan passes (no secrets flagged)

👀 Reviewer Notes


Migration v2 · Docs · Issues

aishwarya-cstk and others added 30 commits June 1, 2026 12:41
…r better handling of missing and media blocks
…aveChangesModal with async handling for step changes"

This reverts commit fe3bfed.
…iple package.json and package-lock.json files
…ng and jetpack/story support

- Added `unwrapSingleChildGroup` function to simplify processing of core/group blocks with a single inner block.
- Updated `createSchema` to utilize the new function for better handling of nested structures.
- Enhanced `schemaMapper` to support jetpack/story blocks, mapping them to a repeatable group with title, alt, caption, and image fields.
- Improved unit tests to validate new functionality for single-child groups and jetpack/story mappings.
…nfig

- Extract and map Contentful taxonomies from export; upload-api and mapper integration
- Contentful service: field/widget helpers, taxonomy metadata locale resolution (mapper + sys.locale)
- API: Vitest thresholds; migration and user unit tests (SSO, createTaxonomy mocks)
- app.json placeholder updates and related fixes
…ganization validation

- Updated saveOAuthToken to render HTML success and error pages upon OAuth token exchange.
- Introduced organization validation to ensure the correct organization is linked during authorization.
- Normalized Contentstack OAuth URLs to avoid issues with hash-style URLs.
- Added utility functions for building HTML responses and escaping text for safety.
- Enhanced the Login component to handle SSO success and error notifications.
- Added unit tests for new utility functions and updated existing tests for auth controller.
…ty tests

- Decreased the branch coverage threshold from 56 to 55 in Vitest configuration.
- Added a new test case to the contentstack-oauth-url utility to handle empty or non-string inputs correctly.
- Moved region configuration to a dedicated constants file for better organization and maintainability.
- Updated various services and components to utilize the new REGION_CONFIG, ensuring optional chaining is applied for safer access to properties.
- Corrected the spelling of 'failureNotification' in multiple locations for consistency.
- Removed unnecessary console logging in contentMapper service.
- Introduced `normalizeNicenameForUid` function to standardize taxonomy UIDs by replacing hyphens and spaces with underscores.
- Enhanced `formatChildByType` to handle child elements more robustly, ensuring correct extraction of attributes and inner blocks.
- Updated `extractItems` and `extractTaxonomy` to utilize the new normalization function for consistent taxonomy UID generation.
- Improved schema mapping for cover blocks to ensure proper handling of inner blocks and attributes.
…d a Set to track source content type UIDs for improved filtering.
- Introduced `getAxiosResponseHeader` to handle both AxiosHeaders and plain object headers, improving header value retrieval.
- Updated asset validation to utilize the new function for content-type checks, enhancing robustness in asset validation logic.
…tallations

- Updated createAppManifest to support fetching marketplace installations when the extension mapper file is missing.
- Introduced marketplaceSourceStackId parameter to allow specifying the source stack for installations.
- Added error handling for installation fetching and ensured proper writing of the app manifest.
- Enhanced unit tests to cover new functionality and edge cases related to marketplace installations.
…Stack function

- Introduced tests for the fetchMarketplaceInstallationsForStack function to validate pagination handling, error scenarios, and logging behavior.
- Ensured proper aggregation of installations based on stack UID and added fallback mechanisms for failed fetch attempts.
- Enhanced test coverage for various edge cases, including handling of non-Error exceptions.
- Replaced  with  for child block UIDs to preserve existing digit-prefixed UIDs during merging.
- Added  function to enhance matching logic by allowing fallback to title for blocks with diverged UIDs.
- Updated merging process to align UIDs and titles with the destination blocks, preventing the creation of duplicates.
- Upgraded @contentstack/cli-utilities to version 1.18.3.
- Updated @contentstack/marketplace-sdk to version 1.5.2.
- Adjusted axios version to 1.15.2 and uuid to 14.0.0.
- Added short-uuid as a new dependency.
- Updated other related dependencies for improved compatibility and performance.
- Replaced inline REGION_CONFIG object in index.ts with import from region-config.json for better maintainability.
- Updated sso.utils.js to reference the new JSON configuration.
- Removed redundant region configuration code from index.ts.
- Introduced hasMeaningfulHtmlContent function to determine if HTML contains substantive content.
- Added attachCoverBackgroundMediaToChildren and attachMediaTextFieldsToChildren functions for improved media handling in core blocks.
- Updated createSchema and schemaMapper functions to accommodate new media-text block processing.
- Refined logic in extractItems and updated MIME type handling in getMimeTypeFromExtension for better robustness.
- Upgraded @contentstack/marketplace-sdk to version 1.5.2.
- Updated axios to version 1.16.0 and follow-redirects to version 1.16.0.
- Added react-toastify for improved user notifications during SSO flow.
- Implemented toast dismissal logic to enhance user experience during SSO process.
umesh-more-cstk and others added 21 commits August 24, 2026 12:45
…sets

extractAssets only read formal wp:post_type=attachment items, so images
embedded in post content (no attachment item backing them) never got a row
on the Map Entry Assets screen, even though the actual migration downloads
and creates them as real Contentstack assets via wordpress.service.ts's
content:encoded scan. Extends extraction to find those images too, matching
the id scheme the real migration uses so uids still resolve, and dedupes
against formal attachment items so an overlapping URL doesn't get two rows.
Editing the file path after selecting a CMS with a single fixed allowed
format (e.g. Sitecore, always Zip) re-derived the displayed "File Format"
from the new path's extension, showing e.g. "XML" instead of staying "Zip".
Only CMS types with more than one allowed format (currently just
stack-to-stack Contentstack) should have the label follow the actual
uploaded extension; everyone else keeps their fixed format, with the
existing validation effect flagging a real mismatch instead.
- extractAssets.ts: cover a[href] image links, audio/source, and CSS
  background-image (inline + <style>), not just img src/data-src/srcset, so
  the same set of embedded assets the real migration finds also get a row.
  Also: skip relative URLs when wp:base_site_url is missing instead of
  emitting a row for an asset the run can't actually resolve.
- LoadFileFormat.tsx: lock the displayed format only when the CMS has
  exactly one allowed format. An empty allowed_file_formats (CMS not yet
  resolved, e.g. Sitecore before a version is picked) now correctly falls
  through to the extension-derived display instead of blanking the field.
Delta Migration | 1.0.0 | In Drupal Assets are not getting attached to entries
usedEntryUids was reserving modelId::locale unconditionally right after
computing uid, before the later contentType/mappedLocale check decided
whether an entry would actually be produced. A file that fell into the
"no content type matched" branch (e.g. a template structure export with
no mapped content type) still consumed the key — permanently blocking a
sibling file sharing that key from producing the real entry, leaving
zero entries instead of one. That's the same "structure entry missing"
symptom QA reopened CMG-1112 for, now made deterministic by the added
sort instead of order-dependent.

Move the reservation into the success branch so a non-producing file
never blocks its sibling, while still guaranteeing at most one entry
per modelId::locale.
Reverts upload-api/src/config/index.ts and index.json to match dev
exactly. These were unrelated trailing-comma/trailing-newline diffs
that had ridden along in this branch's history, not part of the
CMG-1112 fix (flagged in PR review).
fix: stop excluding AEM structure entry from migration (CMG-1112)
Raises every package in the Snyk SLA report to a patched version, plus
newer advisories on the same packages that npm audit reports:

- axios ^1.20.0 (root override, ui, api, upload-api; resolves 1.21.1),
  cli-utilities axios override >=1.20.0, venus-components ^3.0.6
- react-router / react-router-dom ^7.18.7 (ui)
- vite ^7.3.8 (ui); vitest's vite now 8.4.0 (api, upload-api)
- esbuild 0.28.2 in api via tsx 4.23.15
- multer ^2.5.0 (api, upload-api)
- qs ^6.17.1 (root) and override >=6.16.1 (api, upload-api)
- uuid ^11.1.1 forced only for @contentstack/json-rte-serializer@<3 and
  @wordpress/components@<28, the two packages still on uuid 8/9
- .talismanrc: allowlist the regenerated lockfiles (integrity hashes)

showdown has no upstream fix and is no longer a dependency on dev.
mysql2 <= 3.23.0 inflates compressed MySQL protocol packets without a
size limit, so a malicious server can exhaust client memory
(GHSA-rgwj-5xj2-c3m3). Raise mysql2 to ^3.23.1 in api and upload-api
(resolves 3.26.0) and allowlist the regenerated lockfiles in .talismanrc.
@vikrantraut-cstk
vikrantraut-cstk requested review from a team as code owners December 1, 2026 10:56
@snyk-io

snyk-io Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 12 10 ✅ Passed
🟠 High Severity 1 451 25 ✅ Passed
🟡 Medium Severity 3 72 500 ✅ Passed
🔵 Low Severity 0 3 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 8 15 / 30 days ⚠️ Warning
🟠 High 0 380 30 / 120 days ⚠️ Warning
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 12
  • High without fixes: 451
  • Medium without fixes: 72
  • Low without fixes: 3

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

The Snyk PR check failed on api/package.json for fast-uri 4.1.2
(interpretation conflict, high, fixed in 4.1.3), pulled in through
@contentstack/cli-utilities. Raise the fast-uri override from >=4.1.1 to
>=4.2.3 in the root, api and upload-api (resolves 4.2.4), which also
covers the newer fast-uri advisories fixed in 4.1.5 and 4.2.3, and
allowlist the regenerated lockfiles in .talismanrc.
@vikrantraut-cstk
vikrantraut-cstk merged commit 43cc31f into bugfix/setup-env-and-win-build Dec 1, 2026
17 checks passed
@vikrantraut-cstk
vikrantraut-cstk deleted the bugfix/snyk-sla-cve-fixes branch December 1, 2026 11:08
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 12 10 ✅ Passed
🟠 High Severity 1 431 25 ✅ Passed
🟡 Medium Severity 3 52 500 ✅ Passed
🔵 Low Severity 0 3 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 8 15 / 30 days ⚠️ Warning
🟠 High 0 380 30 / 120 days ⚠️ Warning
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 12
  • High without fixes: 431
  • Medium without fixes: 52
  • Low without fixes: 3

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

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.

10 participants