# libpng security vulnerability

**URL:** <https://forums.unrealengine.com/t/libpng-security-vulnerability/74771>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [September 29, 2016, 12:38am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771 "2016-09-29T00:38:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [September 29, 2016, 12:38am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/1 "2016-09-29T00:38:13Z")

</div>

The current Unreal Engine 4 releases use libpng 1.5.2 which has a security vulnerability. Google Play store is flagging any APK with this issue: [https://support.google.com/faqs/answer/7011127?hl=en](https://support.google.com/faqs/answer/7011127?hl=en).

I have updated UE4 for Android to libpng 1.5.27 for 4.14. When this change makes it to GitHub master branch I will update this post with the commit.

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [September 29, 2016, 4:17pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/2 "2016-09-29T16:17:31Z")

</div>

so this is not making it int 4.13.1?

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [September 29, 2016, 8:56pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/3 "2016-09-29T20:56:03Z")

</div>

4.13.1 was already completing testing when this came up.

If you have source from GitHub, you can use this ZIP update to get the new libpng version with prebuilt Android libraries:

Updated (x86 and x86\_64 libraries corrected):  
[https://epicgames.app.box.com/s/29cq7otsjhf4j0qvrybtgqfrk5f51t4a](https://epicgames.app.box.com/s/29cq7otsjhf4j0qvrybtgqfrk5f51t4a)

This should work with 4.12.x and 4.13.x as-is; let me know if there are any problems with older releases.

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [September 30, 2016, 1:54am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/4 "2016-09-30T01:54:24Z")

</div>

how exactly are we supposed to install this? i tried deleting the old folder and placing the new one in, i wasnt able to build the engine

so now im trying to just copy this new content in over to the old one, but I’m not sure how to verify this other than trying to go through the whole process and see if google accepts it or not (i dont see any libpng entries in my build logs)

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [September 30, 2016, 2:21am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/5 "2016-09-30T02:21:13Z")

</div>

You need to unzip the file over your engine source NOT delete the old libpng directory; the other platforms still use the older version with this patch.

Recompiling UE4 (or your code project) for Android after this will link with the new version. The build.cs in the libPNG directory controls which version is used based on the target platform.

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [September 30, 2016, 2:26am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/6 "2016-09-30T02:26:02Z")

</div>

thanks, thats what i did, waiting for google to accept it now

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f1d9eaa9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f1d9eaa9](https://forums.unrealengine.com/u/anonymous_user_f1d9eaa9)\
**Post date:** [October 3, 2016, 6:55pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/7 "2016-10-03T18:55:14Z")

</div>

Got bitten by this one during latest update and was trying to build from libpng source myself (having found nothing on GitHub).

Above zip link works fine on 4.11.2 - Thanks Chris!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_14ab9fbb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_14ab9fbb](https://forums.unrealengine.com/u/anonymous_user_14ab9fbb)\
**Post date:** [October 4, 2016, 4:03am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/8 "2016-10-04T04:03:59Z")

</div>

> [@Chris Babcock;602114](#):
>
> You need to unzip the file over your engine source NOT delete the old libpng directory; the other platforms still use the older version with this patch.
> 
> Recompiling UE4 (or your code project) for Android after this will link with the new version. The build.cs in the libPNG directory controls which version is used based on the target platform.

Please, help! My brain is very small( Please, take more detalis instructions.

1. unzip file

I trying:

1. Copy to UE4 (4.12.5)%ROOT%/Engine\Source\ThirdParty\libPNG and run BuildForAndroid.bat

2. recomril my project

3. Google — swear (Libpng library. The vulnerabilities were fixed in libpng v1.0.66, v.1.2.56, v.1.4.19, v1.5.26 or higher. You can find more information about how resolve the issue in this Google Help Center article.)

4. Take UE4 (4.12.5) from GitHub

5. copy to Engine\Source\ThirdParty\libPNG and run BuildForAndroid.bat

6. Compil UE4 and recompil my project

7. Google — swear (Libpng library. The vulnerabilities were fixed in libpng v1.0.66, v.1.2.56, v.1.4.19, v1.5.26 or higher. You can find more information about how resolve the issue in this Google Help Center article.)

Please, help

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [October 4, 2016, 6:09pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/9 "2016-10-04T18:09:04Z")

</div>

1. Get UE4 from GitHub
2. Unzip the ZIP into the directory containing Engine (it should write over old UElibPNG.Build.cs and add libPNG-1.5.27 and BuildForAndroid.bat)
3. Compile UE4 as normal, then your project
4. Package as normal for shipping and upload to Google

BuildForAndroid.bat uses the NDK to compile libpng libs for the 4 architectures. These are already included in the ZIP so you should skip running it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_84bf54741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84bf54741](https://forums.unrealengine.com/u/anonymous_user_84bf54741)\
**Post date:** [October 5, 2016, 2:58am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/10 "2016-10-05T02:58:40Z")

</div>

Is there any way around this for those of us using the launcher version?

---

<div class="post-metadata">

**Author:** ![Aakrasia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aakrasia](https://forums.unrealengine.com/u/Aakrasia)\
**Post date:** [October 5, 2016, 12:50pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/11 "2016-10-05T12:50:32Z")

</div>

+1 for a launcher version fix. We have managed to keep our project on the launcher version so far. Needing to build from source will just needlessly complicate our process.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 6, 2016, 12:36am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/12 "2016-10-06T00:36:00Z")

</div>

+1 for fix in 4.13.2

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_14ab9fbb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_14ab9fbb](https://forums.unrealengine.com/u/anonymous_user_14ab9fbb)\
**Post date:** [October 6, 2016, 4:18pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/13 "2016-10-06T16:18:43Z")

</div>

> [@Chris Babcock;604065](#):
>
> 1. Get UE4 from GitHub
> 2. Unzip the ZIP into the directory containing Engine (it should write over old UElibPNG.Build.cs and add libPNG-1.5.27 and BuildForAndroid.bat)
> 3. Compile UE4 as normal, then your project
> 4. Package as normal for shipping and upload to Google
> 
> BuildForAndroid.bat uses the NDK to compile libpng libs for the 4 architectures. These are already included in the ZIP so you should skip running it.

Thank you so much! It’s WORK!!!

---

<div class="post-metadata">

**Author:** ![JTensai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JTensai](https://forums.unrealengine.com/u/JTensai)\
**Post date:** [October 9, 2016, 3:42pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/14 "2016-10-09T15:42:42Z")

</div>

I too am using the launcher version of 4.13.1 and would like a fix that does not involve building from source. I too got rejected on the play store for security vulnerabilities ☹ and would really like to get my updated app up there.

---

<div class="post-metadata">

**Author:** ![SintJH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SintJH](https://forums.unrealengine.com/u/SintJH)\
**Post date:** [October 11, 2016, 11:48am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/15 "2016-10-11T11:48:36Z")

</div>

Same here; using the launcher to create an APK and my app got rejected by google. My game is for a kids festival that starts soon, so I’m kind of in a pickle right now.  
Is it possible to unzip the libpng anywhere in the folders of the launcher so it updates the libpng or am I thinking too easy (I’m a designer; not a programmer)?

---

<div class="post-metadata">

**Author:** ![Crowsfield](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/crowsfield/32/983195_2.png) [@Crowsfield](https://forums.unrealengine.com/u/Crowsfield)\
**Post date:** [October 11, 2016, 12:59pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/16 "2016-10-11T12:59:00Z")

</div>

Hi There!  
Big on going problem this is. I myself have Blueprint Project and experience the same problems. As far as i now when you don’t work with C++ you don’t have to recompile or am i wrong? if zo how do you recompile a BP type project?  
Android keeps on rejecting my project so please let me know what i do wrong because i have replaced the files as described above.  
thx for any replays!

---

<div class="post-metadata">

**Author:** ![jawilba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jawilba](https://forums.unrealengine.com/u/jawilba)\
**Post date:** [October 11, 2016, 6:27pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/17 "2016-10-11T18:27:46Z")

</div>

To get this to work you need to get the ue4 source from github. [https://github.com/EpicGames/UnrealEngine](https://github.com/EpicGames/UnrealEngine) If you’ve not done this before you’ll need to link github account to your epic account.

On the unrealengine github page click “clone or download” and choose download ZIP. Once downloaded and unzipped you need to download [https://epicgames.app.box.com/s/abvk2gj65pg4ccdoin39sudi9y6uosvb](https://epicgames.app.box.com/s/abvk2gj65pg4ccdoin39sudi9y6uosvb) and unzip into the same directory to overwrite problem files.

Compile UE4 using instruction on the github page I linked above. I’d never done this myself until a few days ago but it was a fairly painless process.

---

<div class="post-metadata">

**Author:** ![manoelneto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@manoelneto](https://forums.unrealengine.com/u/manoelneto)\
**Post date:** [October 11, 2016, 10:25pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/18 "2016-10-11T22:25:18Z")

</div>

> [@Chris Babcock;602013](#):
>
> 4.13.1 was already completing testing when this came up.
> 
> If you have source from GitHub, you can use this ZIP update to get the new libpng version with prebuilt Android libraries: [https://epicgames.app.box.com/s/abvk2gj65pg4ccdoin39sudi9y6uosvb](https://epicgames.app.box.com/s/abvk2gj65pg4ccdoin39sudi9y6uosvb)
> 
> This should work with 4.12.x and 4.13.x as-is; let me know if there are any problems with older releases.

There are a few linking errors when building x86 and x86\_64 APKs. To fix it, the Android.mk file in the zip needs to be modified like this:

Find this line:

```auto

LOCAL_CFLAGS := -O2 -Os -DNDEBUG -fomit-frame-pointer -g0

```

And add this right bellow it:

```auto

ifeq ($(TARGET_ARCH_ABI),x86)
	LOCAL_CFLAGS += -fno-stack-protector
endif
ifeq ($(TARGET_ARCH_ABI),x86_64)
	LOCAL_CFLAGS += -fno-stack-protector
endif

```

Then run “BuildForAndroid.bat” to re-compile the libPNG Android libraries.

The problem is caused UE4 uses the “stack-protector” compiler flag on arm7 and arm64 builds but not on x86/x86\_64 ones, while libPNG was compiled with that flag for all architectures, causing linker conflicts.

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [October 11, 2016, 11:17pm UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/19 "2016-10-11T23:17:50Z")

</div>

Thank you for the report. I’ve made the changes and rebuilt the libraries. The link above has been updated. You only need the new one if you want to target x86 or x86\_64 architectures.

---

<div class="post-metadata">

**Author:** ![Osiris2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Osiris2000](https://forums.unrealengine.com/u/Osiris2000)\
**Post date:** [October 17, 2016, 10:54am UTC](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771/20 "2016-10-17T10:54:26Z")

</div>

> [@SalihBalkan;604814](#):
>
> +1 for fix in 4.13.2

+1 for fix in 4.13.2

[Next page](https://forums.unrealengine.com/t/libpng-security-vulnerability/74771.md?page=2)
