Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1938027 - CVE-2021-20271 rpm: Signature checks bypass via corrupted rpm package [fedora-all]
Summary: CVE-2021-20271 rpm: Signature checks bypass via corrupted rpm package [fedora...
Keywords:
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 33
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-11 23:09 UTC by Todd Cullum
Modified: 2021-06-21 17:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Todd Cullum 2021-03-11 23:09:22 UTC
This is an automatically created tracking bug!  It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.

For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.

For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs

When submitting as an update, use the fedpkg template provided in the next
comment(s).  This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.

Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.

NOTE: this issue affects multiple supported versions of Fedora. While only
one tracking bug has been filed, please correct all affected versions at
the same time.  If you need to fix the versions independent of each other,
you may clone this bug as appropriate.

Comment 1 Todd Cullum 2021-03-11 23:09:46 UTC
Use the following template to for the 'fedpkg update' request to submit an
update for this issue as it contains the top-level parent bug(s) as well as
this tracking bug.  This will ensure that all associated bugs get updated
when new packages are pushed to stable.

=====

# bugfix, security, enhancement, newpackage (required)
type=security

# low, medium, high, urgent (required)
severity=low

# testing, stable
request=testing

# Bug numbers: 1234,9876
bugs=1934125,1938027

# Description of your update
notes=Security fix for [PUT CVEs HERE]

# Enable request automation based on the stable/unstable karma thresholds
autokarma=True
stable_karma=3
unstable_karma=-3

# Automatically close bugs when this marked as stable
close_bugs=True

# Suggest that users restart after update
suggest_reboot=False

======

Additionally, you may opt to use the bodhi web interface to submit updates:

https://bodhi.fedoraproject.org/updates/new

Comment 2 Demi Marie Obenour 2021-03-12 01:25:18 UTC
(In reply to Todd Cullum from comment #1)
> Use the following template to for the 'fedpkg update' request to submit an
> update for this issue as it contains the top-level parent bug(s) as well as
> this tracking bug.  This will ensure that all associated bugs get updated
> when new packages are pushed to stable.
> 
> =====
> 
> # bugfix, security, enhancement, newpackage (required)
> type=security
> 
> # low, medium, high, urgent (required)
> severity=low
> 
> # testing, stable
> request=testing
> 
> # Bug numbers: 1234,9876
> bugs=1934125,1938027
> 
> # Description of your update
> notes=Security fix for [PUT CVEs HERE]
> 
> # Enable request automation based on the stable/unstable karma thresholds
> autokarma=True
> stable_karma=3
> unstable_karma=-3
> 
> # Automatically close bugs when this marked as stable
> close_bugs=True
> 
> # Suggest that users restart after update
> suggest_reboot=False
> 
> ======
> 
> Additionally, you may opt to use the bodhi web interface to submit updates:
> 
> https://bodhi.fedoraproject.org/updates/new

This is severity=critical, not severity=low, and should be request=stable.
Fedora does not sign its metadata, which means this is a critical remote code
execution vulnerability.

Comment 3 Todd Cullum 2021-03-12 01:39:19 UTC
(In reply to Demi Marie Obenour from comment #2)
> (In reply to Todd Cullum from comment #1)
> > Use the following template to for the 'fedpkg update' request to submit an
> > update for this issue as it contains the top-level parent bug(s) as well as
> > this tracking bug.  This will ensure that all associated bugs get updated
> > when new packages are pushed to stable.
> > 
> > =====
> > 
> > # bugfix, security, enhancement, newpackage (required)
> > type=security
> > 
> > # low, medium, high, urgent (required)
> > severity=low
> > 
> > # testing, stable
> > request=testing
> > 
> > # Bug numbers: 1234,9876
> > bugs=1934125,1938027
> > 
> > # Description of your update
> > notes=Security fix for [PUT CVEs HERE]
> > 
> > # Enable request automation based on the stable/unstable karma thresholds
> > autokarma=True
> > stable_karma=3
> > unstable_karma=-3
> > 
> > # Automatically close bugs when this marked as stable
> > close_bugs=True
> > 
> > # Suggest that users restart after update
> > suggest_reboot=False
> > 
> > ======
> > 
> > Additionally, you may opt to use the bodhi web interface to submit updates:
> > 
> > https://bodhi.fedoraproject.org/updates/new
> 
> This is severity=critical, not severity=low, and should be request=stable.
> Fedora does not sign its metadata, which means this is a critical remote code
> execution vulnerability.

Would you please explain why you feel that this is critical[1] in more detail? What would an attack look like? Not in code, but conceptually. If I am an attacker, what would I need to do to exploit a victim, step-by-step?



IIUC, this requires a modified RPM which is NOT present in the repositories. So that means that an attacker would need to gain access to modify the repository content or convince a user to install an RPM from a third party location, or perform at least a man-in-the-middle attack, modifying the RPM. If this were to occur, many other bad things can happen. Please try to be thorough so I can be sure nothing was missed here. Thank you.

1. https://access.redhat.com/security/updates/classification

Comment 4 Demi Marie Obenour 2021-03-12 21:02:38 UTC
(In reply to Todd Cullum from comment #3)
> (In reply to Demi Marie Obenour from comment #2)
> > (In reply to Todd Cullum from comment #1)
> > > Use the following template to for the 'fedpkg update' request to submit an
> > > update for this issue as it contains the top-level parent bug(s) as well as
> > > this tracking bug.  This will ensure that all associated bugs get updated
> > > when new packages are pushed to stable.
> > > 
> > > =====
> > > 
> > > # bugfix, security, enhancement, newpackage (required)
> > > type=security
> > > 
> > > # low, medium, high, urgent (required)
> > > severity=low
> > > 
> > > # testing, stable
> > > request=testing
> > > 
> > > # Bug numbers: 1234,9876
> > > bugs=1934125,1938027
> > > 
> > > # Description of your update
> > > notes=Security fix for [PUT CVEs HERE]
> > > 
> > > # Enable request automation based on the stable/unstable karma thresholds
> > > autokarma=True
> > > stable_karma=3
> > > unstable_karma=-3
> > > 
> > > # Automatically close bugs when this marked as stable
> > > close_bugs=True
> > > 
> > > # Suggest that users restart after update
> > > suggest_reboot=False
> > > 
> > > ======
> > > 
> > > Additionally, you may opt to use the bodhi web interface to submit updates:
> > > 
> > > https://bodhi.fedoraproject.org/updates/new
> > 
> > This is severity=critical, not severity=low, and should be request=stable.
> > Fedora does not sign its metadata, which means this is a critical remote code
> > execution vulnerability.
> 
> Would you please explain why you feel that this is critical[1] in more
> detail? What would an attack look like? Not in code, but conceptually. If I
> am an attacker, what would I need to do to exploit a victim, step-by-step?
> 
> 
> 
> IIUC, this requires a modified RPM which is NOT present in the repositories.
> So that means that an attacker would need to gain access to modify the
> repository content or convince a user to install an RPM from a third party
> location, or perform at least a man-in-the-middle attack, modifying the RPM.
> If this were to occur, many other bad things can happen. Please try to be
> thorough so I can be sure nothing was missed here. Thank you.
> 
> 1. https://access.redhat.com/security/updates/classification

An attacker would need to perform all of the following:

1. Obtain a rogue certificate for mirrors.fedoraproject.org, signed by a
   trusted CA.  This is difficult, but has been done in the past by high-level
   attackers.
   
2. Obtain an on-path network position, such as by DNS poisoning, BGP hijacking,
   convincing the user to connect to a wireless network they control,
   compromising the user’s gateway, or running a rogue DHCP server.
   
3. Serve a modified metalink file that points to a repository they control.

In short, this bug completely nullifies gpgcheck=True.  I think we can agree
that gpgcheck=False is an insecure configuration unless repo_gpgcheck=True
is set.  And on Fedora and CentOS, it is not.

Comment 5 Demi Marie Obenour 2021-03-12 21:03:45 UTC
Also, the detailed description of this bug matches the description of
CVE-2021-3421 (string injection), not CVE-2021-20271 (signature check bypass).

Comment 6 Todd Cullum 2021-03-15 23:17:34 UTC
> An attacker would need to perform all of the following:
> 
> 1. Obtain a rogue certificate for mirrors.fedoraproject.org, signed by a
>    trusted CA.  This is difficult, but has been done in the past by
> high-level
>    attackers.
>    
> 2. Obtain an on-path network position, such as by DNS poisoning, BGP
> hijacking,
>    convincing the user to connect to a wireless network they control,
>    compromising the user’s gateway, or running a rogue DHCP server.
>    
> 3. Serve a modified metalink file that points to a repository they control.
> 
> In short, this bug completely nullifies gpgcheck=True.  I think we can agree
> that gpgcheck=False is an insecure configuration unless repo_gpgcheck=True
> is set.  And on Fedora and CentOS, it is not.

Based off of this, other information, and the CVE confusion mentioned in Comment#5 , I've increased this from Low to Moderate. See below reasoning for why not Critical:

1. This is not Critical as defined on https://access.redhat.com/security/updates/classification . A Critical would be something like a program that is shipped and run by default on every single OS instance in which the victim could have their box taken over by an attacker just being online due to an extremely simple, repeatable, payload being sent to an open port. This (or anything near this) is clearly not the case here.

2. In fact, I would argue that it's not even fitting the description of an Important which states - "This rating is given to flaws that can **easily** compromise the confidentiality, integrity or availability of resources." I would not consider the attack scenario you described as "easy", in comparison with other vulnerabilities where e.g., a server receives a request and replies with confidential information, or allows remote code execution unauthenticated by simply receiving some requests.


This is not to say that this vulnerability is not significant. But the definition of Moderate on aforementioned page is:

>This rating is given to flaws that may be more difficult to exploit but could still lead to some >compromise of the confidentiality, integrity or availability of resources under certain circumstances. >These are the types of vulnerabilities that could have had a Critical or Important impact but are less >easily exploited based on a technical evaluation of the flaw, and/or affect unlikely configurations. 

The steps needed for an attacker to perform this seem to make this flaw best fit as a Moderate. The "certain circumstances" here map directly to your steps 1, 2, and 3 above.

In fact, even by CVSSv3 score definition[1], this is "Attack Complexity: High"

>A successful attack depends on conditions beyond the attacker's control. That is, a successful attack >cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort >in preparation or execution against the vulnerable component before a successful attack can be >expected.[^2] For example, a successful attack may depend on an attacker overcoming any of the >following conditions:

>    The attacker must gather knowledge about the environment in which the vulnerable target/component >exists. For example, a requirement to collect details on target configuration settings, sequence >numbers, or shared secrets.
>    The attacker must prepare the target environment to improve exploit reliability. For example, >repeated exploitation to win a race condition, or overcoming advanced exploit mitigation techniques.
>    **The attacker must inject themselves into the logical network path between the target and the >resource requested by the victim in order to read and/or modify network communications (e.g., a man in >the middle attack).**


1. https://www.first.org/cvss/specification-document

Comment 7 Demi Marie Obenour 2021-03-16 20:23:09 UTC
(In reply to Todd Cullum from comment #6)
> > An attacker would need to perform all of the following:
> > 
> > 1. Obtain a rogue certificate for mirrors.fedoraproject.org, signed by a
> >    trusted CA.  This is difficult, but has been done in the past by
> >    high-level
> >    attackers.
> >    
> > 2. Obtain an on-path network position, such as by DNS poisoning, BGP
> >    hijacking,
> >    convincing the user to connect to a wireless network they control,
> >    compromising the user’s gateway, or running a rogue DHCP server.
> >    
> > 3. Serve a modified metalink file that points to a repository they control.
> > 
> > In short, this bug completely nullifies gpgcheck=True.  I think we can agree
> > that gpgcheck=False is an insecure configuration unless repo_gpgcheck=True
> > is set.  And on Fedora and CentOS, it is not.
> 
> Based off of this, other information, and the CVE confusion mentioned in
> Comment#5 , I've increased this from Low to Moderate. See below reasoning
> for why not Critical:
> 
> 1. This is not Critical as defined on
> https://access.redhat.com/security/updates/classification . A Critical would
> be something like a program that is shipped and run by default on every
> single OS instance in which the victim could have their box taken over by an
> attacker just being online due to an extremely simple, repeatable, payload
> being sent to an open port. This (or anything near this) is clearly not the
> case here.
> 
> 2. In fact, I would argue that it's not even fitting the description of an
> Important which states - "This rating is given to flaws that can **easily**
> compromise the confidentiality, integrity or availability of resources." I
> would not consider the attack scenario you described as "easy", in
> comparison with other vulnerabilities where e.g., a server receives a
> request and replies with confidential information, or allows remote code
> execution unauthenticated by simply receiving some requests.

I also would not consider this to be easy to exploit.  Thank you for the
update.

> This is not to say that this vulnerability is not significant. But the
> definition of Moderate on aforementioned page is:
> 
> > This rating is given to flaws that may be more difficult to exploit but could still lead to some
> > compromise of the confidentiality, integrity or availability of resources under certain circumstances.
> > These are the types of vulnerabilities that could have had a Critical or Important impact but are less
> > easily exploited based on a technical evaluation of the flaw, and/or affect unlikely configurations. 
> 
> The steps needed for an attacker to perform this seem to make this flaw best
> fit as a Moderate. The "certain circumstances" here map directly to your
> steps 1, 2, and 3 above.

That makes sense, thanks!

> In fact, even by CVSSv3 score definition[1], this is "Attack Complexity:
> High"
> 
> > A successful attack depends on conditions beyond the attacker's control. That is, a successful attack
> > cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort
> > in preparation or execution against the vulnerable component before a successful attack can be
> > expected.[^2] For example, a successful attack may depend on an attacker overcoming any of the
> > following conditions:
> 
> >    The attacker must gather knowledge about the environment in which the vulnerable target/component
> >    exists. For example, a requirement to collect details on target configuration settings, sequence
> >    numbers, or shared secrets.
> >    The attacker must prepare the target environment to improve exploit reliability. For example,
> >    repeated exploitation to win a race condition, or overcoming advanced exploit mitigation techniques.
> >    **The attacker must inject themselves into the logical network path between the target and the
> >    resource requested by the victim in order to read and/or modify network communications (e.g., a man in
> >    the middle attack).**
> 
> 
> 1. https://www.first.org/cvss/specification-document

Agreed

Comment 8 Fedora Update System 2021-03-22 12:12:06 UTC
FEDORA-2021-2383d950fd has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-2383d950fd

Comment 9 Fedora Update System 2021-03-22 12:15:51 UTC
FEDORA-2021-8d52a8a999 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-8d52a8a999

Comment 10 Fedora Update System 2021-03-22 12:25:22 UTC
FEDORA-2021-662680e477 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-662680e477

Comment 11 Fedora Update System 2021-03-23 02:00:57 UTC
FEDORA-2021-2383d950fd has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-2383d950fd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-2383d950fd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2021-03-23 02:05:18 UTC
FEDORA-2021-8d52a8a999 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-8d52a8a999`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-8d52a8a999

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2021-03-24 00:41:18 UTC
FEDORA-2021-662680e477 has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-662680e477`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-662680e477

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2021-03-30 00:15:52 UTC
FEDORA-2021-2383d950fd has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2021-03-30 01:10:23 UTC
FEDORA-2021-8d52a8a999 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2021-04-07 15:25:52 UTC
FEDORA-2021-662680e477 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 saber 2021-06-21 17:50:04 UTC
Is there any reason why it is not pushed to RHEL 7? It's a major bug...

Thanks.


Note You need to log in before you can comment on or make changes to this bug.