Skip to content

Commit

Permalink
Coder path traversal is not authorized, bug report provided by Masaak…
Browse files Browse the repository at this point in the history
…i Chida
  • Loading branch information
Cristy committed Jun 2, 2016
1 parent 96b300c commit fc6080f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2016-06-02 6.9.4-7 Cristy <quetzlzacatenango@image...>
* Fix small memory leak (patch provided by Андрей Черный).
* Coder path traversal is not authorized (bug report provided by
Masaaki Chida).

2016-05-31 6.9.4-6 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.4-6, GIT revision 18334:97775b5:20160531.

Expand Down
9 changes: 9 additions & 0 deletions magick/module.c
Expand Up @@ -547,6 +547,15 @@ static MagickBooleanType GetMagickModulePath(const char *filename,
assert(path != (char *) NULL);
assert(exception != (ExceptionInfo *) NULL);
(void) CopyMagickString(path,filename,MaxTextExtent);
#if defined(MAGICKCORE_INSTALLED_SUPPORT)
if (strstr(path,"../") != (char *) NULL)
{
errno=EPERM;
(void) ThrowMagickException(exception,GetMagickModule(),PolicyError,
"NotAuthorized","`%s'",path);
return(MagickFalse);
}
#endif
module_path=(char *) NULL;
switch (module_type)
{
Expand Down
5 changes: 4 additions & 1 deletion magick/xml-tree.c
Expand Up @@ -2140,7 +2140,10 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception)
if ((ignore_depth == 0) && (IsSkipTag(tag) == MagickFalse))
ParseOpenTag(root,tag,attributes);
else
ignore_depth++;
{
ignore_depth++;
(void) DestroyXMLTreeAttributes(attributes);
}
*p=c;
}
else
Expand Down

0 comments on commit fc6080f

Please sign in to comment.