Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOMPurify ReferenceError for shared file preview #570

Open
urandom2 opened this issue May 5, 2022 · 1 comment
Open

DOMPurify ReferenceError for shared file preview #570

urandom2 opened this issue May 5, 2022 · 1 comment

Comments

@urandom2
Copy link

urandom2 commented May 5, 2022

Steps to reproduce

  1. make a file.md text file
  2. share a file with a public link
  3. cloud.example.com/s/kdoyzv8n
  4. open the link

Expected behaviour

I would expect to see a rendered preview of the file

Actual behaviour

instead I just see the loading spinner and then an empty white box

looking at the code and devtools, it seems like my system is expecting but not finding the DOMPurify function. (see the stack trace below.)

Server configuration

Operating system: nixos

Web server: nginx

Database: postgresql

PHP version: 8.0.18

Nextcloud version: 23.0.4

Where did you install Nextcloud from: nix (package manager)

List of activated apps:

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - admin_audit: 1.13.0
  - calendar: 3.2.2
  - cloud_federation_api: 1.6.0
  - cms_pico: 1.0.19
  - comments: 1.13.0
  - contacts: 4.1.0
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_accesscontrol: 1.13.0
  - files_markdown: 2.3.6
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_texteditor: 2.14.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - firstrunwizard: 2.12.0
  - forms: 2.5.0
  - groupfolders: 11.1.2
  - impersonate: 1.10.0
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - nextcloud_announcements: 1.12.0
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - password_policy: 1.13.0
  - polls: 3.6.1
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - recommendations: 1.2.0
  - registration: 1.5.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - spreed: 13.0.5
  - survey_client: 1.11.0
  - systemtags: 1.13.0
  - tasks: 0.14.4
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - twofactor_nextcloud_notification: 3.4.0
  - twofactor_totp: 6.3.0
  - twofactor_webauthn: 0.3.1
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - viewer: 1.7.0
  - workflowengine: 2.5.0
Disabled:
  - circles: 22.1.1
  - encryption
  - files_external
  - files_videoplayer: 1.11.0
  - photos: 1.4.0
  - support: 1.5.0
  - text: 3.4.1
  - user_ldap
  - weather_status: 1.1.0

Nextcloud configuration:

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "version": "23.0.4.1",
        "overwrite.cli.url": "https:\/\/cloud.example.com",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "default_locale": "en_US",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin"
        ],
        "dbtableprefix": "",
        "remember_login_cookie_lifetime": 2764800,
        "apps_paths": [
            {
                "path": "\/var\/lib\/nextcloud\/nix-apps",
                "url": "\/nix-apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/store-apps",
                "url": "\/store-apps",
                "writable": true
            }
        ],
        "appstoreenabled": false,
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "log_type": "syslog",
        "log_level": "2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "US",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***"
        },
        "overwriteprotocol": "https",
        "trusted_domains": [
            "cloud.example.com"
        ]
    }
}

Client configuration

Browser: firefox 99.0.1 and 100.0b9, chromium 101.0.4951.54

Operating system: archlinux

Logs

Browser log

Uncaught ReferenceError: DOMPurify is not defined
    at Object.<anonymous> (public-share.js:55:11)
    at l (jquery.js:3268:31)
    at Object.fireWith [as resolveWith] (jquery.js:3398:7)
    at k (jquery.js:9305:14)
    at XMLHttpRequest.<anonymous> (jquery.js:9548:9)
@Ellpeck
Copy link

Ellpeck commented Jun 23, 2023

I'm also experiencing this same issue, using Nextcloud 26.

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

No branches or pull requests

2 participants