after you erase the packages, you can install php 5.4 from source! this way you have complete control over whats compiled in, and can always have the latest version, in theory free of vulnerabilities.
on centos 6.x, here is my basic compile
yum -y install libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libvpx-devel libpng-devel libXpm-devel freetype-devel gmp-devel libicu-devel gcc-c++ postgresql-devel libxslt-devel ImageMagick-devel libgearman-devel libuuid-devel nginx
./configure --enable-fpm --with-zlib --enable-exif --with-mysql --enable-embedded-mysqli --enable-mysqlnd --with-pcre-regex --with-openssl --with-xsl --enable-zip --enable-gd-native-ttf --with-curl --enable-sockets --with-gmp --enable-bcmath --enable-intl --with-mhash --prefix=/opt/php --with-jpeg-dir=/usr/lib64 --with-vpx-dir=/usr/lib64 --with-gd --with-freetype-dir= --with-bz2 --with-pdo-mysql --enable-mbstring --enable-ftp && make && make install
(be aware, i purposely install in /opt/php, so you may need to adjust your paths)
after that, you may need a few pecl mods... like imagemagick... just down the pecl tarball and:
cd /root/imagick-3.1.0RC2 && phpize && ./configure && make && make install
then you can tune your php.ini to load extensions as needed...