Q. I know how to update my system using yum command. But how can I find out that patch has been applied to a package? How do I search CVE patch number applied to a package under Red Hat / CentOS / RHEL / Fedora Linux?
A. You need to use rpm command. Each rpm package stores information about patches including date, small description and CVE number. You can use the -q query option to display change information for the package.
rpm --changelog option
Use the command as follows:
rpm -q --changelog {package-name}
rpm -q --changelog {package-name} | more
rpm -q --changelog {package-name} | grep CVE-NUMBER
For example find out if CVE-2008-1927 has been applied to perl package or not, enter:
# rpm -q --changelog perl|grep CVE-2008-1927
Sample output:
- CVE-2008-1927 perl: double free on regular expressions with utf8 characters
List all applied patches for php, enter:
# rpm -q --changelog php
Sample output:
* Tue Jun 03 2008 Joe Orton5.1.6-20.el5_2.1 - add security fixes for CVE-2007-5898, CVE-2007-4782, CVE-2007-5899, CVE-2008-2051, CVE-2008-2107, CVE-2008-2108 (#445923) * Tue Jan 15 2008 Joe Orton 5.1.6-20.el5 - use magic.mime provided by file (#240845) - fix possible crash with setlocale() (#428675) * Thu Jan 10 2008 Joe Orton 5.1.6-19.el5 - ext/date: fix test cases for recent timezone values (#266441) * Thu Jan 10 2008 Joe Orton 5.1.6-18.el5 - ext/date: updates for system tzdata support (#266441) * Wed Jan 09 2008 Joe Orton 5.1.6-17.el5 - ext/date: use system timezone database (#266441) * Tue Jan 08 2008 Joe Orton 5.1.6-16.el5 - add dbase extension in -common (#161639) - add /usr/share/php to builtin include_path (#238455) - ext/ldap: enable ldap_sasl_bind (#336221) - ext/libxml: reset stream context (#298031) ......... ... .... * Fri May 16 2003 Joe Orton 4.3.1-3 - link odbc module correctly - patch so that php -n doesn't scan inidir - run tests using php -n, avoid loading system modules * Wed May 14 2003 Joe Orton 4.3.1-2 - workaround broken parser produced by bison-1.875 * Tue May 06 2003 Joe Orton 4.3.1-1 - update to 4.3.1; run test suite - open extension modules with RTLD_NOW rather than _LAZY
How do I find CVE for a rpm file itself?
Above command will query installed package only. To query rpm file, enter:
$ rpm -qp --changelog rsnapshot-1.3.0-1.noarch.rpm | more
Further readings:
- rpm command man page
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 1 comment… read it below or add one }
Thanks for this. It beats the hell out of spending a half hour searching docs on RHN.