nextcloud / nextcloud/files_antivirus

Problems with encryption being enabled

Open
#146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
112
Forks
44
Avg merge
1d 6h
Merged PRs (30d)
20

Description

Steps to reproduce
  1. Enable encryption
  2. Enable antivirus plugin
  3. tail the log
Expected behaviour

Scanning should work, no errors should occur

Actual behaviour

The antivirus plugin spams the log with messages like:

  "reqId": "Vsym1t5rzVkM7MvbdWpB",
  "level": 4,
  "time": "2020-03-21T12:31:59+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "files_antivirus",
  "method": "",
  "url": "--",
  "message": "OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner::run, exception: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.",
  "userAgent": "--",
  "version": "18.0.2.2"
Server configuration

Not sure if that's only 18.x related or happened before

PHP version:
7.3

Nextcloud version: (see Nextcloud admin page)
18.0.2.2

Where did you install Nextcloud from:
manual / tarball

List of activated apps:

% php occ app:list
Enabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - admin_audit: 1.8.0
  - announcementcenter: 3.7.0
  - bruteforcesettings: 1.5.0
  - calendar: 2.0.2
  - cloud_federation_api: 1.1.0
  - comments: 1.8.0
  - contacts: 3.2.0
  - dav: 1.14.0
  - encryption: 2.6.0
  - external: 3.5.0
  - federatedfilesharing: 1.8.0
  - files: 1.13.1
  - files_accesscontrol: 1.8.1
  - files_antivirus: 2.2.1
  - files_external: 1.9.0
  - files_pdfviewer: 1.7.0
  - files_retention: 1.7.0
  - files_rightclick: 0.15.2
  - files_sharing: 1.10.1
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - logreader: 2.3.0
  - lookup_server_connector: 1.6.0
  - nextcloud_announcements: 1.7.0
  - notifications: 2.6.0
  - oauth2: 1.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - provisioning_api: 1.8.0
  - recommendations: 0.6.0
  - serverinfo: 1.8.0
  - settings: 1.0.0
  - sharebymail: 1.8.0
  - socialsharing_email: 2.0.0
  - support: 1.1.0
  - survey_client: 1.6.0
  - systemtags: 1.8.0
  - text: 2.0.0
  - theming: 1.9.0
  - twofactor_backupcodes: 1.7.0
  - twofactor_totp: 4.1.3
  - updatenotification: 1.8.0
  - viewer: 1.2.0
  - workflowengine: 2.0.0
Disabled:
  - federation
  - user_ldap

Nextcloud configuration:

% php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "my.nextcloud.com"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/my.nextcloud.com",
        "dbtype": "mysql",
        "version": "18.0.2.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "enable_previews": true,
        "overwriteprotocol": "https",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "knowledgebaseenabled": true,
        "mysql.utf8mb4": true,
        "memcache.local": "\\OC\\Memcache\\APCu"
    }
}

antivirus is using the clamd UNIX socket, which worked fine actually.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at files_antivirus's BackgroundScanner::run and trace how encryption-related shared files are handled when the clamd UNIX socket is used. Reproduce with encryption and the antivirus plugin enabled, then tail the log while scanning. Done means valid scanning no longer repeatedly logs decryption exceptions for these files.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.