wails/v3/examples/screen
Lea Anthony 3c503f162e fix(security): prevent path traversal in screen example
The asset middleware in the screen example was vulnerable to path traversal
attacks. User-provided URL paths were concatenated directly with the base
directory without validation, allowing attackers to use `../` sequences to
access files outside the intended assets directory.

Changes:
- Use filepath.Join for safe path construction
- Clean paths with filepath.Clean to normalize them
- Validate that the resolved path stays within the assets directory
- Reject requests that would escape the assets directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 06:04:26 +11:00
..
assets [v3-Windows] New DIP system for Enhanced High DPI Monitor Support (#3665) 2024-09-22 08:38:30 +10:00
main.go fix(security): prevent path traversal in screen example 2026-01-22 06:04:26 +11:00
README.md Mac examples + readme updated 2023-10-17 20:25:36 +11:00
screens.go Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00

Screen Example

This example will detect all attached screens and display their details.

Running the example

To run the example, simply run the following command:

go run .

Status

Platform Status
Mac Working
Windows Working
Linux