Symlinks in extensions are resolved incorrectly

RESOLVED WONTFIX

Status

()

Toolkit
Add-ons Manager
RESOLVED WONTFIX
a year ago
a year ago

People

(Reporter: Evgeny Kapun, Unassigned)

Tracking

47 Branch
Unspecified
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
I'm using Debian version of Firefox 47.0.1, which loads system-installed extensions from /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384} (I couldn't reproduce this with official release versions, because they refuse to load unsigned extensions). I found that sometimes symlinks within extensions are resolved to wrong paths.

As an example, I have an extension installed at /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org. Its chrome.manifest file has a line "content    rpcontinued    content/", which maps chrome://rpcontinued/content/ to /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content. So, the URL chrome://rpcontinued/content/settings/jquery.min.js should be mapped to /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content/settings/jquery.min.js.

The file /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content/settings/jquery.min.js exists. If I type "cat /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content/settings/jquery.min.js" in the terminal, it will show it. But Firefox can't find chrome://rpcontinued/content/settings/jquery.min.js. This is because /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org is a symlink to ../../../xul-ext/requestpolicy, and /usr/share/xul-ext/requestpolicy/content/settings/jquery.min.js is a symlink to ../../../../javascript/jquery/jquery.min.js. When accessing the file normally, both symlinks are resolved, so the real path is /usr/share/javascript/jquery/jquery.min.js. But Firefox only resolves the second symlink, so it tries to access the file /usr/share/mozilla/extensions/javascript/jquery/jquery.min.js, which doesn't exist.

So, Firefox tries to resolve symlinks by itself, and does it differently than the kernel. This is a bug.

Short version:
/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org -> ../../../xul-ext/requestpolicy
/usr/share/xul-ext/requestpolicy/content/settings/jquery.min.js -> ../../../../javascript/jquery/jquery.min.js
Correct: /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content/settings/jquery.min.js is /usr/share/javascript/jquery/jquery.min.js
Firefox resolves /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/rpcontinued@amo.requestpolicy.org/content/settings/jquery.min.js into /usr/share/mozilla/extensions/javascript/jquery/jquery.min.js, which is not correct.
Component: Networking: File → XPCOM
Component: XPCOM → Add-ons Manager
Product: Core → Toolkit

Updated

a year ago
Priority: -- → P5
Whiteboard: triaged
This could be a security feature stopping us from breaking out of the extensions directory when traversing links but either way we don't really support using symlinks in extensions so if this is broken it is extremely unlikely we would spend the time to fix it I'm afraid.
Status: UNCONFIRMED → RESOLVED
Last Resolved: a year ago
Priority: P5 → --
Resolution: --- → WONTFIX
Whiteboard: triaged
You need to log in before you can comment on or make changes to this bug.