core icon indicating copy to clipboard operation
core copied to clipboard

Trying to access array offset on value of type bool at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#434"}

Open jtsagar opened this issue 2 years ago • 1 comments

Steps to reproduce

  1. Set 'part_file_in_storage' => false, in config
  2. Disabled encryption
  3. Try to create a file in an SMB share

Expected behaviour

No warning / info / error must appear in log

Actual behaviour

an log line appears

{"reqId":"258b1597-5c50-436b-a2d1-ce0e567db9f5","level":3,"time":"2022-02-05T11:46:26+02:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"something","app":"PHP","method":"PUT","url":"/owncloud/remote.php/dav/files/something/somepath/test.txt","message":"Trying to access array offset on value of type bool at /var/www/owncloud/lib/private/Files/Storage/Wrapper/Encryption.php#434"}

By changing the line 434 from } elseif (empty($encryptionModuleId) && $info['encrypted'] === true) { To

                                   } elseif (empty($encryptionModuleId) && (isset($info['encrypted']) && $info['encrypted'] === true)) {

The error disappears

Server configuration

Operating system: Centos Stream 8

Web server: Apache/2.4.37 (centos)

Database: mysql Ver 15.1 Distrib 10.3.28-MariaDB, for Linux (x86_64) using readline 5.1

PHP version: PHP 7.4.27 (cli) (built: Dec 14 2021 17:17:06) ( NTS )

ownCloud version: 10.9.1.2

Updated from an older ownCloud or fresh install: older

Where did you install ownCloud from: https://download.owncloud.org/community/owncloud-complete-latest.tar.bz2

Signing status (ownCloud 9.0 and above): No errors have been found.

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

jtsagar avatar Feb 05 '22 10:02 jtsagar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 05 '22 01:08 github-actions[bot]

This issue has been automatically closed.

github-actions[bot] avatar Aug 15 '22 01:08 github-actions[bot]