Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
strategy:
fail-fast: false
matrix:
apps: [ng18, ng19, ng20, ng21, ng22]
apps: [ng18, ng19, ng20, ng21, ng22, ng22-zone]
needs: [build-angular, build-angular-server]
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
- uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
languages: javascript
- uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
- uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
2 changes: 1 addition & 1 deletion .github/workflows/stencil-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
strategy:
fail-fast: false
matrix:
apps: [ng18, ng19, ng20, ng21, ng22]
apps: [ng18, ng19, ng20, ng21, ng22, ng22-zone]
needs: [build-angular, build-angular-server]
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [9.0.2](https://github.com/ionic-team/ionic-framework/compare/v9.0.1...v9.0.2) (2026-09-02)

### Bug Fixes

* **angular:** restore change detection for routed pages ([#31414](https://github.com/ionic-team/ionic-framework/issues/31414)) ([65def73](https://github.com/ionic-team/ionic-framework/commit/65def730d3c762c943fca8df82d9fa312360eeef)), closes [#31406](https://github.com/ionic-team/ionic-framework/issues/31406)
* **sanitization:** match onload case- and space-insensitively ([#31417](https://github.com/ionic-team/ionic-framework/issues/31417)) ([ae7d44e](https://github.com/ionic-team/ionic-framework/commit/ae7d44ebdee434d5eceb5ae03b68f9bcc17e6f7b))
* **web-types:** fix web types for `@ionic/vue` ([#30782](https://github.com/ionic-team/ionic-framework/issues/30782)) ([6c33552](https://github.com/ionic-team/ionic-framework/commit/6c335525a4a46f6d6c26e3946a5111dc34f1d0b3))


## [9.0.1](https://github.com/ionic-team/ionic-framework/compare/v9.0.0...v9.0.1) (2026-08-26)

### Bug Fixes
Expand Down
8 changes: 8 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [9.0.2](https://github.com/ionic-team/ionic-framework/compare/v9.0.1...v9.0.2) (2026-09-02)

### Bug Fixes

* **angular:** restore change detection for routed pages ([#31414](https://github.com/ionic-team/ionic-framework/issues/31414)) ([65def73](https://github.com/ionic-team/ionic-framework/commit/65def730d3c762c943fca8df82d9fa312360eeef)), closes [#31406](https://github.com/ionic-team/ionic-framework/issues/31406)
* **sanitization:** match onload case- and space-insensitively ([#31417](https://github.com/ionic-team/ionic-framework/issues/31417)) ([ae7d44e](https://github.com/ionic-team/ionic-framework/commit/ae7d44ebdee434d5eceb5ae03b68f9bcc17e6f7b))


## [9.0.1](https://github.com/ionic-team/ionic-framework/compare/v9.0.0...v9.0.1) (2026-08-26)

### Bug Fixes
Expand Down
26 changes: 13 additions & 13 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/core",
"version": "9.0.1",
"version": "9.0.2",
"description": "Base components for Ionic",
"engines": {
"node": ">= 16"
Expand Down Expand Up @@ -71,7 +71,7 @@
"tslib": "^2.1.0"
},
"devDependencies": {
"@axe-core/playwright": "^4.12.1",
"@axe-core/playwright": "^4.13.0",
"@capacitor/core": "^8.0.0",
"@capacitor/haptics": "^8.0.0",
"@capacitor/keyboard": "^8.0.0",
Expand Down
7 changes: 5 additions & 2 deletions core/scripts/vercel-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,21 @@ echo "--- Step 3: Building Framework Test Apps ---"

# Find the best available app version for a given package.
# Scans the apps/ directory and picks the newest version (reverse version sort).
# An optional ERE in $2 filters the candidates, so variant apps can be excluded.
pick_app() {
local apps_dir="$1/apps"
local filter="${2:-.}"
[ -d "${apps_dir}" ] || return 1
local app
app=$(ls -1d "${apps_dir}"/*/ 2>/dev/null | xargs -n1 basename | sort -V -r | head -1)
app=$(ls -1d "${apps_dir}"/*/ 2>/dev/null | xargs -n1 basename | grep -E "${filter}" | sort -V -r | head -1)
[ -n "${app}" ] && echo "${app}" && return 0
return 1
}

build_angular_test() {
local APP
APP=$(pick_app "${REPO_ROOT}/packages/angular/test") || {
# Plain ngNN only, since ng22-zone sorts above ng22 and isn't a newer Angular.
APP=$(pick_app "${REPO_ROOT}/packages/angular/test" '^ng[0-9]+$') || {
echo "[angular] No test app found, skipping."
return 0
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/components/fab-button/test/a11y/fab-button.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title,
config
);

const results = await new AxeBuilder({ page }).analyze();
// TODO(FW-7733): Remove the disableRules call once the ticket is resolved.
const results = await new AxeBuilder({ page }).disableRules('color-contrast').analyze();
expect(results.violations).toEqual([]);
});
});
Expand All @@ -60,7 +61,8 @@ configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title,
config
);

const results = await new AxeBuilder({ page }).analyze();
// TODO(FW-7733): Remove the disableRules call once the ticket is resolved.
const results = await new AxeBuilder({ page }).disableRules('color-contrast').analyze();
expect(results.violations).toEqual([]);
});
});
Expand Down
23 changes: 23 additions & 0 deletions core/src/components/loading/test/loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import { config } from '../../../global/config';
import { Loading } from '../loading';

describe('loading: custom html', () => {
let consoleWarnSpy: jest.SpyInstance;

beforeEach(() => {
consoleWarnSpy = jest.spyOn(console, 'warn');
// Suppress console.warn output from polluting the test output
consoleWarnSpy.mockImplementation(() => {});
});

afterEach(() => {
consoleWarnSpy.mockRestore();
});

it('should not allow for custom html by default', async () => {
const page = await newSpecPage({
components: [Loading],
Expand All @@ -15,6 +27,17 @@ describe('loading: custom html', () => {
expect(content.querySelector('button.custom-html')).toBe(null);
});

it('should discard a message carrying an onload handler', async () => {
config.reset({ innerHTMLTemplatesEnabled: true });
const page = await newSpecPage({
components: [Loading],
html: `<ion-loading message="<svg><svg onLoad='alert(1)'></svg></svg>Custom Text"></ion-loading>`,
});

const content = page.body.querySelector('.loading-content')!;
expect(content.innerHTML).toEqual('');
});

it('should allow for custom html', async () => {
config.reset({ innerHTMLTemplatesEnabled: true });
const page = await newSpecPage({
Expand Down
22 changes: 14 additions & 8 deletions core/src/utils/sanitization/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { printIonError } from '@utils/logging';
import { printIonError, printIonWarning } from '@utils/logging';

/**
* Sanitize an untrusted HTML string.
Expand All @@ -19,8 +19,8 @@ import { printIonError } from '@utils/logging';
* @param untrustedString - The HTML string to sanitize. Pass an
* `IonicSafeString` to bypass sanitization, or `undefined` to short-circuit.
* @returns The sanitized HTML string, or `undefined` if the input was
* `undefined`. Returns `''` if sanitization fails or the input contains
* an inline `onload=` handler.
* `undefined`. Returns `''` if sanitization fails or the input appears to
* carry an inline `onload` handler.
*/
export const sanitizeDOMString = (untrustedString: IonicSafeString | string | undefined): string | undefined => {
try {
Expand All @@ -32,12 +32,18 @@ export const sanitizeDOMString = (untrustedString: IonicSafeString | string | un
}

/**
* onload is fired when appending to a document
* fragment in Chrome. If a string
* contains onload then we should not
* attempt to add this to the fragment.
* In Blink a non-outermost `<svg>` (e.g. `<svg><svg onload=...>`) fires
* its load handler while `innerHTML` below parses the string, so it runs
* before the attribute-stripping pass can remove it. The match has to
* stay this loose because attribute names are case-insensitive and
* whitespace is allowed before the `=`.
*/
if (untrustedString.includes('onload=')) {
if (/onload\s*=/i.test(untrustedString)) {
printIonWarning(
'sanitizeDOMString - Content was discarded because it appears to contain an onload handler:',
untrustedString.substring(0, 100)
);

return '';
}

Expand Down
39 changes: 39 additions & 0 deletions core/src/utils/sanitization/test/sanitization.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { blockedTags, IonicSafeString, reflectPropertiesToAttributes, sanitizeDOMString, sanitizeDOMTree } from '..';

describe('sanitizeDOMString', () => {
let consoleWarnSpy: jest.SpyInstance;

beforeEach(() => {
consoleWarnSpy = jest.spyOn(console, 'warn');
// Suppress console.warn output from polluting the test output
consoleWarnSpy.mockImplementation(() => {});
});

afterEach(() => {
consoleWarnSpy.mockRestore();
});

it('disable sanitizer', () => {
enableSanitizer(false);
expect(sanitizeDOMString('<img src="x" onerror="alert(document.cookie);">')).toEqual(
Expand All @@ -26,6 +38,33 @@ describe('sanitizeDOMString', () => {
).toEqual('<button id="myButton" name="myButton">harmless button</button>');
});

it('filter onload', () => {
/**
* Only a non-outermost `<svg>` fires its load handler mid-parse, so the
* nesting is what makes these payloads real.
*/
expect(sanitizeDOMString('<svg><svg onload=alert(document.cookie)></svg></svg>')).toEqual('');
expect(sanitizeDOMString('<svg><svg onLoad=alert(document.cookie)></svg></svg>')).toEqual('');
expect(sanitizeDOMString('<svg><svg ONLOAD=alert(document.cookie)></svg></svg>')).toEqual('');
expect(sanitizeDOMString('<svg><svg onload =alert(document.cookie)></svg></svg>')).toEqual('');
});

it('filter onload discards benign content too (known false positive)', () => {
/**
* The check runs before parsing, so it can't tell an attribute from a
* URL or from prose. Both of these lose their whole string.
*/
expect(sanitizeDOMString('<a href="/docs?onload=1">docs</a>')).toEqual('');
expect(sanitizeDOMString('<a href="/docs?onLoad=1">docs</a>')).toEqual('');
});

it('warn when content is discarded by the onload check', () => {
sanitizeDOMString('<svg><svg onLoad=alert(document.cookie)></svg></svg>');

expect(consoleWarnSpy).toHaveBeenCalledTimes(1);
expect(consoleWarnSpy.mock.calls[0][0]).toContain('onload handler');
});

it('filter <a> href JS', () => {
expect(sanitizeDOMString('<a href="javascript:alert(document.cookie)">harmless link</a>')).toEqual(
'<a>harmless link</a>'
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It is based on <a href="https://www.webcomponents.org/introduction">Web Componen
| Project | Package | Documentation | Guides |
| ---------------- | -------------------------------------------------------------------------- | ---------------------------------| ----------------------------------------------------------------- |
| **Core** | [`@ionic/core`](https://www.npmjs.com/package/@ionic/core) | [Readme](core/README.md) | [Testing](core/testing/README.md) |
| **Angular** | [`@ionic/angular`](https://www.npmjs.com/package/@ionic/angular) | [Readme](angular/README.md) | [Testing](angular/testing.md) |
| **Angular** | [`@ionic/angular`](https://www.npmjs.com/package/@ionic/angular) | [Readme](angular/README.md) | [Testing](angular/testing.md), [Change Detection](angular/change-detection.md) |
| **React** | [`@ionic/react`](https://www.npmjs.com/package/@ionic/react) | [Readme](react/README.md) | [Testing](react/testing.md) |
| **React Router** | [`@ionic/react-router`](https://www.npmjs.com/package/@ionic/react-router) | [Readme](react-router/README.md) | [Testing](react-router/testing.md) |
| **Vue** | [`@ionic/vue`](https://www.npmjs.com/package/@ionic/vue) | [Readme](vue/README.md) | [Testing](vue/testing.md) |
Expand Down
4 changes: 4 additions & 0 deletions docs/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ See our [Contributing Guide](/docs/CONTRIBUTING.md).
## Testing

Refer to the [Angular Testing documentation](./testing.md) for testing the Angular package.

## Change Detection

Refer to the [Angular Change Detection documentation](./change-detection.md) for the strategy every component must declare.
Loading
Loading