Repository navigation
Vaadin Flow Components V14.14.4
Vaadin Flow Components 14.14.4
This is a release of the Java integration for Vaadin Components to be used from the Java server side with Vaadin Flow.
Changes in Flow Components from 14.14.3
Changes in vaadin-charts-flow
- New Features:
-
⧉ Validate navigation-related URL schemes (CP: 14.14). PR:9710
This PR cherry-picks changes from the original PR #9447 to branch 14.14. Because URL scheme validation is disabled by default in 14.14 (
DeploymentConfiguration#getUrlSafeSchemes()allows all schemes unless configured), and because some components differ frommain, the backport was adapted: - Scope:SideNavItemandBreadcrumbsItemdo not exist in 14.14, andLoginOverlayTestis not present either, so they are excluded. Only Charts (Credits,Exporting) and Login (AbstractLogin#setAction) are validated. - Javadoc: the@throwsclauses reference{@link DeploymentConfiguration#getUrlSafeSchemes()}, since validation only rejects schemes that are not in the configured safe set (allow-all by default). This also adds the previously missing@throwsonCredits#setHref. -AbstractLogin#setAction: keeps the existing simple behavior of this branch plus the new validation andsetUnsafeAction. - Tests: use JUnit 4 (as used by these modules in 14.14) and mockVaadinService/DeploymentConfigurationto enable validation, since it is off by default.mockito-inlinewas added to the Charts and Login test dependencies for static mocking. The Login module is on JUnit 4.12, so its throwing test uses@Test(expected = ...). --- > ## Motivation > > Mirror the Flow URL-scheme validation (vaadin/flow#24539) for the navigation, action and link sinks in flow-components. Ajavascript:(or other non-allow-listed) scheme on a value that the browser later treats as a link, form action or script source is a familiar XSS shape; rejecting it at the setter closes that path while leaving an explicit escape hatch for trusted, hard-coded URLs. > > ## Changes > > Validating setters added across the affected components, each with a matchingsetUnsafe*variant that bypasses validation: > > -SideNavItem.setPath/BreadcrumbsItem.setPath— navigation link. > -Credits.setHref— clickable Highcharts credits link. > -AbstractLogin.setAction— the formactionattribute the browser POSTs to on submit. > -Exporting.setUrl— Highcharts posts SVG to this URL as a form action for export fallback. > -Exporting.setLibURL— concatenated into<script src="…">to load offline-export dependencies at runtime. > >SideNavItemandBreadcrumbsItemconstructors that take aString pathvalidate transitively viasetPath; their Javadoc now documents@throws IllegalArgumentExceptionand explicit constructor tests cover the behaviour. > > Safe schemes are configured through thecom.vaadin.safeUrlSchemesproperty and default tohttp,https,mailto,tel,ftp. > > Image, icon, SVG, Avatar, map tile and chart-resource URLs are intentionally not validated:javascript:cannot execute in<img src>/ SVG<image>elements, anddata:URLs are a legitimate, common use there. > >LoginFormTestandLoginOverlayTestalready mockLoggerFactoryto capture the existing "action attribute together with login listeners" warning. After merging Flow main, those tests started NPE-ing: Flow'sUrlUtil.isSafeUrldebug-logs a fallback notice, going throughLoggerFactory.getLogger(UrlUtil.class)which returnednullinside the broad mock. The mock now usesMockito.CALLS_REAL_METHODSso unrelated lookups fall through to the real factory; the explicitLoginForm/Overlay.classstubs still take precedence. > > Part of vaadin/flow#24539 --- 🤖 Generated with Claude Code
-
Changes in vaadin-login-flow
- New Features:
-
⧉ Validate navigation-related URL schemes (CP: 14.14). PR:9710
This PR cherry-picks changes from the original PR #9447 to branch 14.14. Because URL scheme validation is disabled by default in 14.14 (
DeploymentConfiguration#getUrlSafeSchemes()allows all schemes unless configured), and because some components differ frommain, the backport was adapted: - Scope:SideNavItemandBreadcrumbsItemdo not exist in 14.14, andLoginOverlayTestis not present either, so they are excluded. Only Charts (Credits,Exporting) and Login (AbstractLogin#setAction) are validated. - Javadoc: the@throwsclauses reference{@link DeploymentConfiguration#getUrlSafeSchemes()}, since validation only rejects schemes that are not in the configured safe set (allow-all by default). This also adds the previously missing@throwsonCredits#setHref. -AbstractLogin#setAction: keeps the existing simple behavior of this branch plus the new validation andsetUnsafeAction. - Tests: use JUnit 4 (as used by these modules in 14.14) and mockVaadinService/DeploymentConfigurationto enable validation, since it is off by default.mockito-inlinewas added to the Charts and Login test dependencies for static mocking. The Login module is on JUnit 4.12, so its throwing test uses@Test(expected = ...). --- > ## Motivation > > Mirror the Flow URL-scheme validation (vaadin/flow#24539) for the navigation, action and link sinks in flow-components. Ajavascript:(or other non-allow-listed) scheme on a value that the browser later treats as a link, form action or script source is a familiar XSS shape; rejecting it at the setter closes that path while leaving an explicit escape hatch for trusted, hard-coded URLs. > > ## Changes > > Validating setters added across the affected components, each with a matchingsetUnsafe*variant that bypasses validation: > > -SideNavItem.setPath/BreadcrumbsItem.setPath— navigation link. > -Credits.setHref— clickable Highcharts credits link. > -AbstractLogin.setAction— the formactionattribute the browser POSTs to on submit. > -Exporting.setUrl— Highcharts posts SVG to this URL as a form action for export fallback. > -Exporting.setLibURL— concatenated into<script src="…">to load offline-export dependencies at runtime. > >SideNavItemandBreadcrumbsItemconstructors that take aString pathvalidate transitively viasetPath; their Javadoc now documents@throws IllegalArgumentExceptionand explicit constructor tests cover the behaviour. > > Safe schemes are configured through thecom.vaadin.safeUrlSchemesproperty and default tohttp,https,mailto,tel,ftp. > > Image, icon, SVG, Avatar, map tile and chart-resource URLs are intentionally not validated:javascript:cannot execute in<img src>/ SVG<image>elements, anddata:URLs are a legitimate, common use there. > >LoginFormTestandLoginOverlayTestalready mockLoggerFactoryto capture the existing "action attribute together with login listeners" warning. After merging Flow main, those tests started NPE-ing: Flow'sUrlUtil.isSafeUrldebug-logs a fallback notice, going throughLoggerFactory.getLogger(UrlUtil.class)which returnednullinside the broad mock. The mock now usesMockito.CALLS_REAL_METHODSso unrelated lookups fall through to the real factory; the explicitLoginForm/Overlay.classstubs still take precedence. > > Part of vaadin/flow#24539 --- 🤖 Generated with Claude Code
-