Wrong escaping backslach in directory name #2593

Closed
opened 2026-02-05 06:15:01 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @marcin-github on GitHub (Mar 14, 2024).

The bug

I noticed that directory contained backslash in the name aren't correctly proccessed:

immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] Unable to run job handler (library/library-refresh-asset): BadRequestException: Cannot acce
ss file
immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] BadRequestException: Cannot access file
immich_microservices | at LibraryService.handleAssetRefresh (/usr/src/app/dist/domain/library/library.service.js:363:23)
immich_microservices | at async /usr/src/app/dist/domain/job/job.service.js:137:37
immich_microservices | at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
immich_microservices | at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] Object:
immich_microservices | {
immich_microservices | "id": "1cc889e2-9374-4242-b698-cb57449a54de",
immich_microservices | "assetPath": "/mnt/media/yyy/Bozena/xxxxxx.jpg",
immich_microservices | "ownerId": "5a54fc18-4669-448c-a2d3-0604465d438c",
immich_microservices | "force": false
immich_microservices | }
immich_microservices |

Real path is

/mnt/media/yyy/Bozena\/xxxxxx.jpg

The OS that Immich Server is running on

docker container

Version of Immich Server

1.98.2

Version of Immich Mobile App


Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

---

Your .env content

---

Reproduction steps

---

Additional information

No response

Originally created by @marcin-github on GitHub (Mar 14, 2024). ### The bug I noticed that directory contained backslash in the name aren't correctly proccessed: immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] Unable to run job handler (library/library-refresh-asset): BadRequestException: Cannot acce ss file immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] BadRequestException: Cannot access file immich_microservices | at LibraryService.handleAssetRefresh (/usr/src/app/dist/domain/library/library.service.js:363:23) immich_microservices | at async /usr/src/app/dist/domain/job/job.service.js:137:37 immich_microservices | at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28) immich_microservices | at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24) immich_microservices | [Nest] 7 - 03/14/2024, 10:02:50 AM ERROR [JobService] Object: immich_microservices | { immich_microservices | "id": "1cc889e2-9374-4242-b698-cb57449a54de", immich_microservices | "assetPath": "/mnt/media/yyy/Bozena/xxxxxx.jpg", immich_microservices | "ownerId": "5a54fc18-4669-448c-a2d3-0604465d438c", immich_microservices | "force": false immich_microservices | } immich_microservices | Real path is ``` /mnt/media/yyy/Bozena\/xxxxxx.jpg ``` ### The OS that Immich Server is running on docker container ### Version of Immich Server 1.98.2 ### Version of Immich Mobile App --- ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML --- ``` ### Your .env content ```Shell --- ``` ### Reproduction steps ```bash --- ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Mar 14, 2024):

Do you mean that you have a filename with a slash in it?

@bo0tzz commented on GitHub (Mar 14, 2024): Do you mean that you have a filename with a slash in it?
Author
Owner

@marcin-github commented on GitHub (Mar 14, 2024):

Directory contains backslash \ in the name

//edit

this file doesn't appears in table "assets".

@marcin-github commented on GitHub (Mar 14, 2024): Directory contains backslash \ in the name //edit this file doesn't appears in table "assets".
Author
Owner

@mmomjian commented on GitHub (Mar 14, 2024):

Are you saying the name of the directory is Bozena\? this is a really unfortunate naming structure and I would strongly recommend renaming it.

@mmomjian commented on GitHub (Mar 14, 2024): Are you saying the name of the directory is `Bozena\`? this is a really unfortunate naming structure and I would strongly recommend renaming it.
Author
Owner

@marcin-github commented on GitHub (Mar 15, 2024):

One thing is if such chars are usefull ;) Second thing is how application deal with it (or maybe there are other chars that are problematic)? Also if app has problem with it could it become some kind of security issue?

@marcin-github commented on GitHub (Mar 15, 2024): One thing is if such chars are usefull ;) Second thing is how application deal with it (or maybe there are other chars that are problematic)? Also if app has problem with it could it become some kind of security issue?
Author
Owner

@alextran1502 commented on GitHub (Mar 15, 2024):

We sanitize such character to avoid path traversing attack

@alextran1502 commented on GitHub (Mar 15, 2024): We sanitize such character to avoid path traversing attack
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2593