Skip to content

fix: contain Directory-scoped paths to their target directory - #17

Merged
OS-pedrogustavobilro merged 2 commits into
mainfrom
fix/IONIC-102/canonical-paths
Sep 8, 2026
Merged

OS-pedrogustavobilro merged 2 commits into
mainfrom
fix/IONIC-102/canonical-paths

Conversation

@OS-pedrogustavobilro

@OS-pedrogustavobilro OS-pedrogustavobilro commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

⚠️ 🤖 AI-assisted development with Claude, with manual testing done by a human.

This PR fixes an issue that allowed non-canonical file paths to be provided with IONFILEDirectoryType enum. E.g. if a user specified IONFILEDirectoryType.cache but then used ../Documents, could access files in documents folder when it was meant to access in cache; or trying to plant a simlink inside path. Now such accesses are blocked. Callers that intentionally need to use a path outside a given directory scenario should use a raw file path.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Internal JIRA Reference: https://outsystemsrd.atlassian.net/browse/IONIC-102 (point 1. regarding filesystem plugin)

Similar PR for Android: ionic-team/ion-android-filesystem#11

Tests or Reproductions

Refer to unit tests added that show use cases that get fixed with this PR.

To test in an actual mobile app, you may use a specific branch/commit from the Capacitor Filesystem plugin. On the bottom of the screen, buttons were added that test different use cases of escaping file paths outside the provided Directory. You should press the run all checks button.

@andredestro andredestro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the IONFilesystemLib.zip intentional here?

@OS-pedrogustavobilro

Copy link
Copy Markdown
Contributor Author

Is the IONFilesystemLib.zip intentional here?

It is not, I was testing building the xcframework and must have commited that file accidentally. Removing it, thanks!

@OS-pedrogustavobilro
OS-pedrogustavobilro merged commit 40a2f20 into main Sep 8, 2026
1 check passed
@OS-pedrogustavobilro
OS-pedrogustavobilro deleted the fix/IONIC-102/canonical-paths branch September 8, 2026 16:11
capacitor-bot pushed a commit that referenced this pull request Sep 8, 2026
## [1.1.4](1.1.3...1.1.4) (2026-09-08)

### Bug Fixes

* contain Directory-scoped paths to their target directory ([#17](#17)) ([40a2f20](40a2f20))
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