Dhaval Giani [Sat, 27 Jun 2020 06:13:17 +0000 (23:13 -0700)]
Add the ImageDepth tag to ExifTags. This tag is used to identify the (#47)
depth of an image.
For more details, take a look at https://exiftool.org/TagNames/EXIF.html
Marcus Meissner [Mon, 8 Jun 2020 15:29:14 +0000 (17:29 +0200)]
note for CVE-2020-0198
Marcus Meissner [Mon, 8 Jun 2020 15:27:06 +0000 (17:27 +0200)]
fixed another unsigned integer overflow
first fixed by google in android fork,
https://android.googlesource.com/platform/external/libexif/+/
1e187b62682ffab5003c702657d6d725b4278f16%5E%21/#F0
(use a more generic overflow check method, also check second overflow instance.)
https://security-tracker.debian.org/tracker/CVE-2020-0198
Marcus Meissner [Sat, 6 Jun 2020 07:16:51 +0000 (09:16 +0200)]
added french
Stéphane Aulery [Sat, 6 Jun 2020 07:16:42 +0000 (09:16 +0200)]
updated french
Marcus Meissner [Fri, 5 Jun 2020 05:54:03 +0000 (07:54 +0200)]
rtans updates
Yuri Chornoivan [Thu, 21 May 2020 07:23:37 +0000 (09:23 +0200)]
updated ukrainian
Jakub Bogusz [Thu, 21 May 2020 07:23:10 +0000 (09:23 +0200)]
updated polish
Antonio Ceballos [Thu, 21 May 2020 07:22:32 +0000 (09:22 +0200)]
updated spanish
Dan Fandrich [Mon, 18 May 2020 22:40:29 +0000 (00:40 +0200)]
Add a couple of Travis builds on Ubuntu focal.
Marcus Meissner [Mon, 18 May 2020 16:52:08 +0000 (18:52 +0200)]
start development 0.6.22.1
Marcus Meissner [Mon, 18 May 2020 15:58:47 +0000 (17:58 +0200)]
0.6.22 release
fixes https://github.com/libexif/libexif/issues/12
Marcus Meissner [Mon, 18 May 2020 15:53:45 +0000 (17:53 +0200)]
SECURITY.md added to EXTRA_DIST, make distcheck otherwise does not like it
Marcus Meissner [Sun, 17 May 2020 16:33:19 +0000 (18:33 +0200)]
first update
Marcus Meissner [Sun, 17 May 2020 16:24:07 +0000 (18:24 +0200)]
added me, some security related work
Marcus Meissner [Sun, 17 May 2020 08:20:15 +0000 (10:20 +0200)]
handle illegal offsets earlier
Bail out if an offset runs over the datasize.
fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20065&q=libexif&can=2
Woodrow Douglass [Sun, 17 May 2020 07:03:45 +0000 (03:03 -0400)]
Add support for Composite Image tags from Exif 2.32 (#40)
Hugh McMaster [Sun, 17 May 2020 06:49:31 +0000 (16:49 +1000)]
Rename 'binary' directory to 'binary-dist' (#43)
* Rename 'binary' directory to 'binary-dist'
Debian invokes a 'binary' target in its build process. The presence of
the 'binary' directory breaks the automated build, as 'make' thinks the
target has already been invoked.
* Use substitution variable for 'mkdir -p' instead of hard-coding the command
Dan Fandrich [Sat, 16 May 2020 21:15:37 +0000 (23:15 +0200)]
Fix an unused variable warning.
Dan Fandrich [Sat, 16 May 2020 17:32:30 +0000 (19:32 +0200)]
Add a failsafe on the maximum number of Canon MakerNote subtags.
A malicious file could be crafted to cause extremely large values in some
tags without tripping any buffer range checks. This is bad with the libexif
representation of Canon MakerNotes because some arrays are turned into
individual tags that the application must loop around.
The largest value I've seen for failsafe_size in a (very small) sample of valid
Canon files is <5000. The limit is set two orders of magnitude larger to avoid
tripping up falsely in case some models use much larger values.
Patch from Google.
CVE-2020-13114
Dan Fandrich [Wed, 25 Sep 2019 14:02:08 +0000 (16:02 +0200)]
Fix stack buffer overflows in exif_content_dump and exif_entry_dump.
If too large an indent is given, a local buffer will overflow. This
can't happen when called through exif_data_dump (which is likely the
most common case) and since they are documented as being for diagnostic
purposes only, this shouldn't pose too big a security risk in the wild.
Reported-by: jonnygrant.
(not exploitable by malicious data)
Dan Fandrich [Sat, 16 May 2020 17:29:21 +0000 (19:29 +0200)]
Ensure the MakerNote data pointers are initialized with NULL.
This ensures that an uninitialized pointer isn't dereferenced later in
the case where the number of components (and therefore size) is 0.
This fixes the second issue reported at
https://sourceforge.net/p/libexif/bugs/125/
CVE-2020-13113
Dan Fandrich [Sat, 16 May 2020 15:32:28 +0000 (17:32 +0200)]
Fix MakerNote tag size overflow issues at read time.
Check for a size overflow while reading tags, which ensures that the
size is always consistent for the given components and type of the
entry, making checking further down superfluous.
This provides an alternate fix for
https://sourceforge.net/p/libexif/bugs/125/ CVE-2016-6328 and for all
the MakerNote types. Likely, this makes both commits
41bd0423 and
89e5b1c1 redundant as it ensures that MakerNote entries are well-formed
when they're populated.
Some improvements on top by Marcus Meissner <marcus@jet.franken.de>
CVE-2020-13112
Marcus Meissner [Sat, 16 May 2020 14:17:42 +0000 (16:17 +0200)]
reduce code in fuzzer
Marcus Meissner [Sat, 16 May 2020 15:20:53 +0000 (17:20 +0200)]
add extern "C" wrapper
fixes https://github.com/libexif/libexif/issues/41
Marcus Meissner [Sat, 16 May 2020 14:47:42 +0000 (16:47 +0200)]
libexif: Fix read buffer overflow (CVE-2020-0093)
Make sure the number of bytes being copied from doesn't exceed the
source buffer size.
From Android repo:
https://android.googlesource.com/platform/external/libexif/+/
0335ffc17f9b9a4831c242bb08ea92f605fde7a6%5E%21/#F0
Test: testPocBug_148705132
Bug:
148705132
fixes https://github.com/libexif/libexif/issues/42
Dan Fandrich [Sun, 26 Apr 2020 15:41:18 +0000 (17:41 +0200)]
Switch to sourceline syntax for the toolchain PPA in Travis.
Dan Fandrich [Sat, 25 Apr 2020 21:24:05 +0000 (23:24 +0200)]
Reorganize some Travis builds.
Travis defaults to xenial these days, so some builds were redundant.
Add gcc9, clang9 and clang10 builds. Switch the sanitize build to
clang10. Add a PPC build.
Marcus Meissner [Sat, 29 Feb 2020 20:12:26 +0000 (21:12 +0100)]
add a SECURITY.md, describe attack surface and valid attack scenarios
orangesnn [Mon, 24 Feb 2020 07:16:02 +0000 (15:16 +0800)]
Update the exif-entry.c (#32)
dividing by zero
Crane [Mon, 24 Feb 2020 06:50:06 +0000 (14:50 +0800)]
bugfix: change 0xa000 tag name (#38)
According to DC-08-2012
FlashPixVersion shoule be FlashpixVersion
orangesnn [Sun, 23 Feb 2020 09:28:19 +0000 (17:28 +0800)]
Update exif-loader.c (#33)
undefined behaviour : cannot be represented in type 'int'
Marcus Meissner [Sat, 18 Jan 2020 18:50:38 +0000 (19:50 +0100)]
cast to unsigned int before shifting left
(weird integer promotion, a unsigned char will be first tried to be promoted to "int" apparently,
so we need to cast it to avoid implicit behaviour)
fixes https://github.com/libexif/libexif/issues/20
Marcus Meissner [Sat, 18 Jan 2020 08:29:42 +0000 (09:29 +0100)]
fix CVE-2019-9278
avoid the use of unsafe integer overflow checking constructs (unsigned integer operations cannot overflow, so "u1 + u2 > u1" can be optimized away)
check for the actual sizes, which should also handle the overflows
document other places google patched, but do not seem relevant due to other restrictions
fixes https://github.com/libexif/libexif/issues/26
Dan Fandrich [Fri, 13 Dec 2019 07:46:51 +0000 (08:46 +0100)]
cirrus: Switch the FreeBSD 12.x build to 12.1 and drop 10.4.
Upstream support for 10.4 ended a year ago, and it looks like the image
is now gone, too.
[skip ci]
Dan Fandrich [Tue, 5 Nov 2019 15:18:02 +0000 (16:18 +0100)]
Fix decoding of Windows XP proprietary tags on big-endian machines.
Reported by Thorsten Otto. Fixes #22.
Dan Fandrich [Wed, 4 Jul 2018 09:06:09 +0000 (11:06 +0200)]
Fix a buffer read overflow in exif_entry_get_value
While parsing EXIF_TAG_FOCAL_LENGTH it was possible to read 8 bytes past
the end of a heap buffer. This was detected by the OSS Fuzz project.
Patch from Google.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7344 and
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14543
Dan Fandrich [Fri, 19 Jul 2019 10:36:01 +0000 (12:36 +0200)]
EXIF_TAG_GAMMA is found in Exif 2.3
Dan Fandrich [Thu, 17 Oct 2019 04:52:47 +0000 (06:52 +0200)]
Increase the git clone depth.
If more commits are submitted to master between the time of triggering
the first Cirrus build and the time the final build gets started, the
desired commit is no longer at HEAD and the build will error out.
[skip ci]
Dan Fandrich [Wed, 16 Oct 2019 20:26:04 +0000 (22:26 +0200)]
Add an ARM64 build on Travis.
Dan Fandrich [Wed, 11 Sep 2019 08:06:12 +0000 (10:06 +0200)]
Switch the Cirrus FreeBSD 11.x build to 11.3 and add a 13.0 build.
Also, select the images using image_family to get the latest snapshots
automatically.
[skip ci]
Dan Fandrich [Fri, 9 Aug 2019 09:26:03 +0000 (11:26 +0200)]
Relicensed my contributions to stdint.m4 under LGPL.
This brings the file under the same license as the rest of the project
by default, and eliminates the ambiguous (but well-intentioned) license
under which it was supplied.
[skip ci]
Dan Fandrich [Wed, 31 Jul 2019 13:00:29 +0000 (15:00 +0200)]
Enabled -Werror on some Travis builds.
This will cause any compiler warnings to be treated as errors and fail
the CI build. A couple of warnings are grandfathered in until they are
fixed in the code.
The -Werror switch can't be added to the CFLAGS on the configure command
because it causes some autoconf tests to fail. Instead, it's appended to
the existing flags at make time.
Dan Fandrich [Wed, 31 Jul 2019 17:03:10 +0000 (19:03 +0200)]
Fixed a couple of compiler warnings.
Dan Fandrich [Wed, 31 Jul 2019 22:09:34 +0000 (00:09 +0200)]
Make failmalloc disable itself on program exit.
Something in the Travis build environment has changed recently to cause
failmalloc runs to crash while exiting due to a NULL pointer dereference
in the coverage writing code. This fix causes failmalloc to
automatically disable itself once main() exits so subsequent memory
requests always succeed. Since the application (and library) have no
control over what happens during exit cleanup anyway, this does not
affect its functionality.
Dan Fandrich [Wed, 31 Jul 2019 14:39:11 +0000 (16:39 +0200)]
Switched a few builds to use the slightly more modern Xenial.
This fixes the clang6 build since the Trusty environment has started
complaining that libjsoncpp0 doesn't exist when trying to install
clang-6.0.
Dan Fandrich [Thu, 25 Jul 2019 13:31:42 +0000 (15:31 +0200)]
Add a few more NULL pointer checks.
Extended test-null.c to verify them.
Fixes #19 (reported by jonnygrant@).
Dirk Farin [Mon, 1 Jul 2019 14:08:14 +0000 (16:08 +0200)]
German translation for new Exif 2.3 tags
Dirk Farin [Mon, 1 Jul 2019 13:52:33 +0000 (15:52 +0200)]
add new tags from Exif 2.3 specification
Dan Fandrich [Fri, 19 Jul 2019 16:33:11 +0000 (18:33 +0200)]
Documented some return values in the case of errors.
Also, added docs for a few functions that were missing them.
Fixes issue #18.
[skip ci]
Dan Fandrich [Wed, 17 Jul 2019 13:26:32 +0000 (15:26 +0200)]
Stopped printing some values as int in exif_mnote_data_get_value
This is the same change as the previous one but for the MakerNotes.
Patch from Google.
Dan Fandrich [Fri, 12 Jul 2019 16:01:47 +0000 (18:01 +0200)]
Stopped printing some values as int in exif_entry_get_value
By leaving them as double, it avoids undefined behaviour when the values
are out of the range of an int. This also has the side effect of
rounding some values to the nearest integer, improving display accuracy.
Patch from Google.
Dan Fandrich [Fri, 18 May 2018 16:09:24 +0000 (18:09 +0200)]
Added a comment regarding malformed UTF-16 strings.
Dan Fandrich [Mon, 18 Jun 2018 10:41:15 +0000 (12:41 +0200)]
Avoid OOB read on short buffer in various Olympus-like MakerNotes.
A sanity check on entry to the block ensures a minimum buffer size, so a few
other checks were redundant and could actually be removed. This improves
on commit
a0c04d9c.
Fixes https://sourceforge.net/p/libexif/bugs/132/ found by the Google
Autofuzz project. Patch from Google.
Marcus Meissner [Sat, 15 Jun 2019 16:40:48 +0000 (18:40 +0200)]
fixed a buffer overread (OSS-Fuzz)
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8884
Dan Fandrich [Tue, 21 May 2019 13:16:32 +0000 (15:16 +0200)]
Increase git clone depth in Travis.
The value of 1 caused problems when more than one commit was pushed but
the most recent commit(s) had a "skip ci" note. Travis would try to
build from a prior new commit without the tag but it would fail because
only the most recent was available.
Dan Fandrich [Tue, 21 May 2019 13:15:56 +0000 (15:15 +0200)]
Removed some extraneous space characters from translations.
[skip ci]
Dan Fandrich [Fri, 10 May 2019 14:10:34 +0000 (16:10 +0200)]
Added some missing Language: tags in some .po files.
[skip ci]
Dan Fandrich [Fri, 10 May 2019 14:01:31 +0000 (16:01 +0200)]
Added two new strings for translation to all the .po files.
All the line numbering and wrapping changes were dropped to avoid
needless churn.
Dan Fandrich [Fri, 10 May 2019 11:02:01 +0000 (13:02 +0200)]
Changed some printf specifiers in translation files to match.
This was done blindly to a bunch of .po files to remove some fuzzy
translation specifiers after a few type changes.
Dan Fandrich [Sat, 27 Apr 2019 17:28:47 +0000 (19:28 +0200)]
Added test-null to check that the API handles NULL arguments.
Dan Fandrich [Sat, 27 Apr 2019 17:30:01 +0000 (19:30 +0200)]
Don't crash if exif_content_ref/unref is passed NULL.
The rest of the API functions already handle NULL values.
Dan Fandrich [Thu, 11 Apr 2019 08:36:13 +0000 (10:36 +0200)]
Travis build updates.
Added a clang-8 build configuration and switched the sanitize
configuration to also use clang-8. Removed the clang7 build since
that's the version already used in bionic and xenial. Enabled LSAN leak
checker on the sanitize build.
Dan Fandrich [Tue, 9 Apr 2019 12:38:04 +0000 (14:38 +0200)]
Added Travis builds on Ubuntu xenial and bionic.
Dan Fandrich [Mon, 8 Apr 2019 13:06:12 +0000 (15:06 +0200)]
Ignore return value of bindtextdomain() to silence "result unused" warnings.
Patch from Google.
Dan Fandrich [Mon, 8 Apr 2019 12:25:55 +0000 (14:25 +0200)]
Added a Travis build with --disable-nls
Hugh McMaster [Fri, 29 Mar 2019 10:35:50 +0000 (21:35 +1100)]
Remove several unused macro files
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Hugh McMaster [Thu, 28 Mar 2019 12:24:22 +0000 (23:24 +1100)]
Update Doxyfile templates to prevent compile-time warnings
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Dan Fandrich [Mon, 11 Mar 2019 21:48:20 +0000 (22:48 +0100)]
Added a clang-7 Travis build configuration.
Also, switched the sanitize configuration to use clang-7.
Dan Fandrich [Fri, 1 Mar 2019 11:01:34 +0000 (12:01 +0100)]
Added stricter ASAN checks in the Travis sanitize build.
Dan Fandrich [Thu, 28 Feb 2019 23:46:40 +0000 (00:46 +0100)]
Mention that Portuguese translations now come from Translation Project.
[skip ci]
Dan Fandrich [Thu, 28 Feb 2019 14:53:07 +0000 (15:53 +0100)]
Configure CI builds with --disable-dependency-tracking to speed them up.
Dan Fandrich [Sat, 23 Feb 2019 15:23:20 +0000 (16:23 +0100)]
Fixed typo in last commit.
Dan Fandrich [Sat, 23 Feb 2019 14:36:37 +0000 (15:36 +0100)]
Fixed a potential NPE in exif_mnote_data_pentax_save
Found by Coverity.
Dan Fandrich [Fri, 22 Feb 2019 15:17:01 +0000 (16:17 +0100)]
Added test-extract.c and a new regression test extract-parse.sh.
This extracts the EXIF tags from an image then compares the parsed value
of the extracted tags with those of the original file. This ensures that
the tags are written properly, without change in tag data. The MakerNote
tag sometimes has a harmless, slight difference in size because of
padding being removed.
However, in developing this test, I found that the Olympus variant 4
MakerNote has a huge size difference. This might be harmless (there
might just be a lot of padding removed) but it's also possible that
these MakerNotes aren't being properly parsed. This discrepancy should
be investigated.
The exif_data_save_data() function is also returning some JPEG markers
at the end of the buffer which I wasn't expecting. This also should be
investigated.
The test is enabled anyway in the meantime to reduce the chance of
regressions in the remaining tags.
Dan Fandrich [Fri, 22 Feb 2019 15:51:27 +0000 (16:51 +0100)]
Fixed a compiler warning in test-fuzzer
Dan Fandrich [Fri, 12 Oct 2018 14:01:45 +0000 (16:01 +0200)]
Improve deep recursion detection in exif_data_load_data_content.
The existing detection was still vulnerable to pathological cases
causing DoS by wasting CPU. The new algorithm takes the number of tags
into account to make it harder to abuse by cases using shallow recursion
but with a very large number of tags. This improves on commit
5d28011c
which wasn't sufficient to counter this kind of case.
The limitation in the previous fix was discovered by Laurent Delosieres,
Secunia Research at Flexera (Secunia Advisory SA84652) and is assigned
the identifier CVE-2018-20030.
Dan Fandrich [Thu, 7 Feb 2019 11:01:32 +0000 (12:01 +0100)]
Retry on error when downloading failmalloc in the Travis build.
Dan Fandrich [Tue, 5 Feb 2019 10:09:58 +0000 (11:09 +0100)]
Set the buffer size to 0 to indicate an error in exif_loader_get_buf.
Otherwise, the caller has no way of knowing an error occurred, such as the NULL
check done in the previous commit.
Dan Fandrich [Mon, 4 Feb 2019 15:27:17 +0000 (16:27 +0100)]
Fixed a potential NULL pointer dereference in exif_loader_get_buf.
This would only happen if given a NULL pointer by the application.
Found by Clang scan-build.
Dan Fandrich [Sat, 2 Feb 2019 19:01:49 +0000 (20:01 +0100)]
Added FreeBSD builds on Cirrus CI.
Build results will be at
https://cirrus-ci.com/github/libexif/libexif
Marcus Meissner [Sat, 2 Feb 2019 18:04:59 +0000 (19:04 +0100)]
handle non-0 terminated value returns as failure
Marcus Meissner [Sat, 2 Feb 2019 18:04:29 +0000 (19:04 +0100)]
the USERCOMMENT field should be returned \0 terminated (AFL)
Marcus Meissner [Sat, 2 Feb 2019 17:52:28 +0000 (18:52 +0100)]
abort early... we can get a very high number and this does not help
Dan Fandrich [Fri, 1 Feb 2019 11:29:02 +0000 (12:29 +0100)]
Add a MUSL build on Travis.
kyububba [Mon, 7 Jan 2019 14:19:41 +0000 (06:19 -0800)]
Add GPSHPositioningError tag defined in exif version 2.3.1 (#7)
* Update exif-tag.h
* Update exif-tag.c
Dan Fandrich [Fri, 30 Nov 2018 13:17:55 +0000 (14:17 +0100)]
Reformatted the matrix section of the Travis config file.
Dan Fandrich [Fri, 30 Nov 2018 09:37:39 +0000 (10:37 +0100)]
Added an ARM cross-compile build to Travis.
Dan Fandrich [Fri, 30 Nov 2018 12:46:10 +0000 (13:46 +0100)]
Fixed cross-compiling with the default options.
The failmalloc check doesn't make sense when cross-compiling, and
configure even errored out in this case.
Dan Fandrich [Sat, 10 Nov 2018 13:16:47 +0000 (14:16 +0100)]
Add check-failmalloc.sh to test OOM conditions.
This requires Failmalloc, a library that can be used along with glibc to
cause malloc calls to fail in a defined way. Configure will search for
libfailmalloc.so.0 in the usual places by default, or in a
user-specified location. The tests are skipped if it's not available.
Enable Failmalloc on the Travis coverage build.
Dan Fandrich [Fri, 9 Nov 2018 17:18:33 +0000 (18:18 +0100)]
Removed obsolete comment.
Dan Fandrich [Wed, 7 Nov 2018 19:19:18 +0000 (20:19 +0100)]
Added an Appveyor configuration for msys2.
[ci skip]
Dan Fandrich [Tue, 6 Nov 2018 00:03:54 +0000 (01:03 +0100)]
Enable AM_SILENT_RULES by default.
Verbose compile commands can be re-enabled with "make V=1" which is done
on the continuous build systems for easier debugging.
Dan Fandrich [Mon, 5 Nov 2018 23:53:56 +0000 (00:53 +0100)]
Be a bit more robust in the face of out-of-memory errors.
Do a better job in leaving things in a more consistent state after an
allocation failure. Also, make the tests report and handle OOM
conditions cleanly.
Dan Fandrich [Mon, 5 Nov 2018 20:44:37 +0000 (21:44 +0100)]
Run the libexif-testsuite tests in parallel now that they can be.
Dan Fandrich [Sat, 3 Nov 2018 15:43:24 +0000 (16:43 +0100)]
Use a glob to find test-suite.log on a failing Travis build.
When running on libexif-testsuite, the file is in tests/ not test/.
Dan Fandrich [Thu, 1 Nov 2018 17:32:04 +0000 (18:32 +0100)]
Added the test/testdata/* files to the dist tar ball.
This was missed in commit
5c93e6b4.
Dan Fandrich [Thu, 1 Nov 2018 13:24:31 +0000 (14:24 +0100)]
Add swap-byte-order.sh to test libexif's byte order conversion function.
This is accomplished by adding a feature to test-parse.c to switch the
byte order before dumping the EXIF output. Additionally, the MakerNote
values are now logged in the dump as well, in the same way as the
regular tags, to better catch regressions.
This new test uncovered a bug in the decoding of the
MNOTE_NIKON_TAG_FIRMWARE tag whose data should not be treated as being
endian-specific.
Dan Fandrich [Thu, 1 Nov 2018 10:23:06 +0000 (11:23 +0100)]
Added a thumbnail to test-mem.c to ensure it's properly freed.
Dan Fandrich [Wed, 31 Oct 2018 14:11:51 +0000 (15:11 +0100)]
Use exif_mnote_data_get_name in test-parse.c
This is analagous to exif_tag_get_name that is used for the regular
tags.