Skip to content

[Snyk] Fix for 3 vulnerabilities - #17

Open
agha4to wants to merge 1 commit into
mainfrom
snyk-fix-e48bb8c4512480b2fa8eb98f25c4d14b
Open

[Snyk] Fix for 3 vulnerabilities#17
agha4to wants to merge 1 commit into
mainfrom
snyk-fix-e48bb8c4512480b2fa8eb98f25c4d14b

Conversation

@agha4to

@agha4to agha4to commented Feb 17, 2025

Copy link
Copy Markdown
Owner

snyk-top-banner

Snyk has created this PR to fix 3 vulnerabilities in the yarn dependencies of this project.

Snyk changed the following file(s):

  • packages/backend/package.json

Note for zero-installs users

If you are using the Yarn feature zero-installs that was introduced in Yarn V2, note that this PR does not update the .yarn/cache/ directory meaning this code cannot be pulled and immediately developed on as one would expect for a zero-install project - you will need to run yarn to update the contents of the ./yarn/cache directory.
If you are not using zero-install you can ignore this as your flow should likely be unchanged.

⚠️ Warning
Failed to update the yarn.lock, please update manually before merging.

Vulnerabilities that will be fixed with an upgrade:

Issue Score
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-OCTOKITPLUGINPAGINATEREST-8730855
  738  
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-OCTOKITREQUEST-8730853
  738  
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-OCTOKITREQUESTERROR-8730854
  738  

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Regular Expression Denial of Service (ReDoS)

agha4to pushed a commit that referenced this pull request Jun 17, 2026
…H-452) (lightdash#24251)

* feat(common): cast day-or-coarser DATE_TRUNCs to DATE in getSqlForTruncatedDate

Adds an opt-in castDayGrainToDate param: day-or-coarser truncations cast the project-wall-clock value to DATE (dropping the toUTC round-trip-back); sub-day grains stay TIMESTAMP. Dormant until the query builder passes the flag (behind EnableTimezoneSupport).

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(backend): wire day-or-coarser DATE cast through MetricQueryBuilder

getTimezoneAwareDimensionSql passes castDayGrainToDate=true to getSqlForTruncatedDate (reached only when useTimezoneAwareDateTrunc is on), so day-or-coarser SELECT and WHERE-LHS expressions emit CAST(... AS DATE). Adds a MetricQueryBuilder integration test.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(common): emit bare date literals for day-grain filters

Day-or-coarser dims now compile to a real DATE LHS (CAST(... AS DATE)), so their filter literals and relative-filter boundaries stay bare across warehouses — wrapping them as timestamptz would re-introduce the tz drift the cast removes. Updates the filter-literal-wrapping test suite to the new bare contract; adds a MetricQueryBuilder integration test.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(common): collapse calendar-value predicates so day-grain DATE no longer shifts

isCalendarValueDimension is now true for any DATE-typed field and shouldShiftItemTimezone false for them, since day-or-coarser truncs compile to a real DATE (the single update point GLITCH-450 consolidated). formatItemValue, spreadsheet exports, drill-filter normalization and the ECharts category-date axis all stop shifting day-grain DATE values — fixing the negative-offset off-by-one. Tests updated to the no-shift contract.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(common): emit YYYY-MM-DD raw values for DATE fields in tz-aware mode

formatRawValue gains an optional timezone param: when a display timezone is resolved (tz-aware mode on), DATE fields emit a bare YYYY-MM-DD raw matching the warehouse type; undefined keeps the legacy ISO output (byte-identical, flag-off). Threaded via the timezone formatRow already passes, plus formatRawRows for subtotals (resolving the gated displayTimezone once) and the pivot-values path. The value is never shifted — the tz is only a mode signal.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(timezones): split MIN/MAX out of GLITCH-452 to GLITCH-499

The design doc's MIN/MAX section described the wrong failure mode (a
date-string fall-through). The real issue: MAX/MIN over a DATE value is
tz-shifted because the formatter branch catches both the JS Date and the
ISO-midnight string and shifts them. Fixing it needs a metric-level type
signal, which is out of scope for 452 — split to GLITCH-499 and corrected
the analysis in the Scope list and §3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(timezones): update timezone-handling.md for the GLITCH-452 DATE cast

Day-or-coarser TIMESTAMP-base truncations now compile to a real DATE
(CAST of the truncated wall-clock), so the engineer-facing reference is
updated across: SELECT grouping (per-grain output type), filter parity +
bare-date literals, result formatting + the removed correction layer,
the raw wire value, cell-actions (normalizeCellRawForFilter is now an
inert no-op since the predicate collapse), the ECharts shift scope, and
the overview/vision diagrams. Sub-day grains still return a UTC instant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(common): cast day-grain to DATE via DATE(expr, tz) on BigQuery

BigQuery's TIMESTAMP_TRUNC returns the tz-midnight value as a UTC instant,
so CAST(... AS DATE) read its UTC date and bucketed day-or-coarser grains a
day early in positive-offset project timezones (Europe/Asia/Australia). Use
DATE(expr, tz) on BigQuery to read the calendar date in the project tz; other
adapters truncate to wall-clock, so CAST AS DATE stays correct there.

Found via cross-warehouse execution testing: Asia/Tokyo bucketed a 15:00Z row
to the previous day on BigQuery, while Snowflake/Databricks/Trino were correct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(timezones): update GLITCH-452 design doc with implementation outcomes

Status → implemented/in-review; add an "Implementation status & outcomes"
section (BigQuery DATE(expr,tz) per-adapter fix, 6/6 cross-warehouse pass,
downstream surface validated, normalizeCellRawForFilter now inert). Resolve
the §1 "decision to confirm" lines (date-zoom not cast → GLITCH-505;
per-adapter cast required + verified) and mark the §5 tests, risks, and
docs-to-update items done. Follow-ups: GLITCH-499 / GLITCH-503 / GLITCH-505.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(timezones): record downstream blast-radius audit in GLITCH-452 design doc

Audit verdicts (all flag-gated): custom dimensions, conditional formatting,
result caching, saved filters, underlying-data/drill, sorting & totals all
inert. One genuine breaking case — raw-SQL table calcs with TIMESTAMP-specific
ops on truncated date dims (GLITCH-506). Latent/pre-existing noted: MIN/MAX-on-
date in CF (GLITCH-499) and the PoP range pre-filter coercion (GLITCH-505).

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(common): align createFilterRuleFromField date tests with the predicate collapse

GLITCH-452 makes day-or-coarser TIMESTAMP-base truncs compile to a real DATE,
so they are calendar values and the drill/filter path no longer shifts them.
Update the stale lightdash#22895 tests (which fed the old UTC-instant representation and
expected a project-tz shift) to the post-452 model: bare cast dates are not
shifted, and a legacy UTC-instant value is read at UTC.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(backend): DATE-base-TS Excel cells are not shifted post-cast (GLITCH-452)

The predicate collapse makes day-or-coarser TIMESTAMP-base truncs real DATEs
(calendar values), so convertRowToExcel no longer shifts them. Update the stale
test that fed the old UTC-instant and expected a project-tz shift: feed the bare
cast date and assert no shift, matching the native-DATE case.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(api-tests): add timezone boundary-crossing battery (GLITCH-452)

Adds day/month/year/DST boundary-crossing tests over the timezone_test boundary
rows (11-18) at offsets that flip a boundary — year (#17 → 2023 in NY), month
(#18 → Feb in Tokyo/Kiritimati+14), Tokyo-midnight day (#11), fractional
St_Johns (-3:30), and US spring/fall DST days. Asserts the bare-date raw bucket
to rule out double conversions. Verified 12/12 against a flag-enabled backend.

Adds an eventIds scope + getRawBucketMap helper to support boundary-row queries.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(frontend): DATE-base-TS day buckets are not axis-shifted post-cast (GLITCH-452)

After merging main, resolveAxisTimezone (which gates on shouldShiftItemTimezone)
no longer shifts a DATE day bucket derived from a TIMESTAMP base — the cast makes
it a real DATE calendar value. Flip main's stale test to expect no shift, matching
the native-DATE case.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(backend): DATE-base-TS CSV cells are not shifted post-cast (GLITCH-452)

Last of the stale correction-layer tests: a day-or-coarser TIMESTAMP-base trunc
is now a real DATE (calendar value), so convertRowToCsv does not shift it. Flip
the expectation to no-shift, matching the native-DATE case. Verified against the
full backend/common/frontend suites — no remaining stale tests.

Relates: GLITCH-452

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agha4to pushed a commit that referenced this pull request Jun 17, 2026
# [0.3174.0](lightdash/lightdash@0.3173.0...0.3174.0) (2026-06-16)

### Features

* **timezone:** cast day-or-coarser DATE_TRUNCs to a real DATE (GLITCH-452) ([lightdash#24251](lightdash#24251)) ([e149743](lightdash@e149743)), closes [lightdash#22895](lightdash#22895) [#17](lightdash#17) [#18](lightdash#18) [#11](lightdash#11)
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.

2 participants