Code Monkey home page Code Monkey logo

archive's People

Contributors

achal-aggarwal avatar aliasm2k avatar c-lodder avatar dongilbert avatar dryabov avatar eddieajau avatar florianv avatar frankmayer avatar hackwar avatar joomla-jenkins avatar laoneo avatar mbabker avatar nibra avatar pborreli avatar photodude avatar rdeutz avatar realityking avatar relater avatar sharkykz avatar wilsonge avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archive's Issues

CVE-2021-26028 fix needs back porting from CMS to this repo

Steps to reproduce the issue

https://developer.joomla.org/security-centre/848-20210308-core-path-traversal-within-joomla-archive-zip-class.html

libraries/joomla/archive/zip.php in joomla/joomla-cms@aadf697

Expected result

Issues fixed in the CMS are backported/contributed/coordinated by the JSST with the framework packages

Actual result

Reported Date: 2020-09-08
Fixed Date: 2021-03-02
Todays date 5th March 2021
Framework Still vulnerable...

Joomla Archive extract uppercase ZIP causes “Unknown archive type”

Steps to reproduce the issue

$archive = new Archive; 
$archive->extract( 'something.ZIP', $this->tmp_directory);

Expected result

Success

Actual result

Unknown archive type: ZIP

System information (as much as possible)

Linux/Apache/Joomla 3.9.3

Additional comments

If renamed to something.zip it works.

Extracting an archive using streams fails.

First of all checkout https://bugs.php.net/bug.php?id=63195&edit=1
Now if you extract an bzip2 archive with use_stream option enabled then it doesn't extract file. It throws an exception.
On further checking I found out that on second iteration of reading (do-while loop) in Stream::read it got empty string and that caused exception.

Same is the case with gzip archive extraction using streams.

Non-specific error messages are frustrating and useless to the user

Steps to reproduce the issue

  • Install a component, e.g. com_foobar
  • Make its directory (administrator/components/com_foobar) read-only
  • Try to install an update, or the same version even, from a ZIP file

Expected result

Something along the lines of Cannot write to file /home/example/public_html/administrator/components/com_foobar/foobar.php

Actual result

The useless, if not misleading, error message Unable to write entry

System information (as much as possible)

Irrelevant.

Additional comments

The Joomla! extensions installer simply dumps the message from the RuntimeException you are throwing in the Zip and Tar classes. For example, in the ZIP class you have this code (one of two areas in the class that need to be changed):

				// Make sure the destination folder exists
				if (!Folder::create(dirname($path)))
				{
					throw new \RuntimeException('Unable to create destination');
				}

				if (!File::write($path, $buffer))
				{
					throw new \RuntimeException('Unable to write entry');
				}

These are useless error messages. It'd be better if you did:

				// Make sure the destination folder exists
				if (!Folder::create(dirname($path)))
				{
					throw new \RuntimeException('Unable to create destination folder ' . dirname($path));
				}

				if (!File::write($path, $buffer))
				{
					throw new \RuntimeException('Unable to write to file ' . $path);
				}

It doesn't matter if you are a developer using this class in your own code or an end user. These messages are thrown when there is a filesystem access issue. If you don't know where in the filesystem the issue is you cannot fix it. Moreover, "write entry" means exactly nothing, zero, nada, zilch to someone who ends up seeing this error message. Even worse, there is no indication it's a filesystem issue. The first thing that springs to mind is "database error".

This issue will be referenced in my documentation as Yet Another Joomla! Bug which prevents my clients from installing my extensions while making it impossible for me to support them. I can't help them if there is no indication of whether the problem is Joomla! extracting the extensions from the package ZIP or extracting an extension ZIP to the temporary folder or something else. No useful feedback from Joomla! = bug. Please fix it. I've provided the solution for your convenience.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.