NET-SNMP-EXTEND-MIB::nsExtendCacheTime cannot be set anymore

Bug #1892980 reported by azrle
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Fix Released
Undecided
Leonidas S. Barbosa

Bug Description

As 5.7.3+dfsg-1.8ubuntu3.5 released, it makes the extend mib read-only in order to solve CVE-2020-15862.

However, it also makes nsExtendCacheTime cannot be modified anymore.

$ snmpset -v1 -c xxx localhost "NET-SNMP-EXTEND-MIB::nsExtendCacheTime.\"test\"" i 0
Error in packet.
Reason: (genError) A general failure occured
Failed object: NET-SNMP-EXTEND-MIB::nsExtendCacheTime."test"

As the nsExtendCacheTime cannot be set in snmpd.conf until 5.8, we can never configure it.

IMHO, the patch https://sourceforge.net/p/net-snmp/patches/1290/ should also be introduced along with the patch for CVE-2020-15862, so that we can configure nsExtendCacheTime in snmpd.conf.

https://github.com/net-snmp/net-snmp/commit/d8b12900629ed73a78b27535f08c4f0a721a93be

CVE References

Revision history for this message
azrle (azrlew) wrote :
Revision history for this message
Paride Legovini (paride) wrote :

Hello and thanks for this bug report and for the pointer to the upstream commit implementing -cacheTime and -execType. I can see how those would bring the functionality back, however they can be considered "new features", which are rarely introduced with stable release updates, and with extra care. This will require some discussion.

[1] https://wiki.ubuntu.com/StableReleaseUpdates

tags: added: server-triage-discuss
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Subscribing Leonidas who did the CVE fix and tagging regression-update.
Since the break is pushed to -security the fixup (if any) will need to land there as well.
Also he will have more experience in security fixes that suddenly make new features required to work around new limitations.

@Leonidas what is your advice how to go on here?

tags: added: regression-update
removed: server-triage-discuss
Revision history for this message
Leonidas S. Barbosa (leosilvab) wrote :

Hi,

Sorry for the inconvenient. We (security team) are/will analyze what would be a better solution here.

Revision history for this message
Leonidas S. Barbosa (leosilvab) wrote :

Also, would mind to provide detailed steps in how to reproduce this issue?

I wasn't so far able to reproduce it.

Revision history for this message
azrle (azrlew) wrote :

Hi,

Thanks for following up.
Here are steps to reproduce it.

1. Login to an Ubuntu 18 server.
e.g.

docker run --name ubuntu18 -it ubuntu:bionic

2. apt-get update

3. apt-get install snmp snmp-mibs-downloader snmpd
(5.7.3+dfsg-1.8ubuntu3.5 will be installed)

4. Use the following config:

cat << EOF > /etc/snmp/snmpd.conf
com2sec private localhost test
group readwrite v1 private

view all included .1 80
access readonly "" any noauth exact all none none
access readwrite "" any noauth exact all all none

extend unixtime /bin/date +%s
EOF

5. service snmpd start

6. Run tests

The following command to set cache time to -1 will fail:
snmpset -v1 -c test localhost 'NET-SNMP-EXTEND-MIB::nsExtendCacheTime."unixtime"' i -1

We can also observe that nsExtendCacheTime is still 5 seconds.
snmpwalk -v1 -c test localhost "NET-SNMP-EXTEND-MIB::nsExtendCacheTime"

And the following result will be cached for 5 seconds.
snmpwalk -v1 -c test localhost 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."unixtime"'

7. Test another versions

apt-get install libsnmp30=5.7.3+dfsg-1.8ubuntu3 \
snmp=5.7.3+dfsg-1.8ubuntu3 \
snmpd=5.7.3+dfsg-1.8ubuntu3

pkill snmpd

Then, repeat steps 5, 6, it will success to change cache time to -1 and the result is not cached anymore, which is our expected behavior.

Let me know if you have any problem to reproduce the issue.

Revision history for this message
Leonidas S. Barbosa (leosilvab) wrote :

Hi azrle!

Thanks a lot for the detailed steps. I now could reproduce it. I'll issue a new update adding the feature flags that allow cachetime be set. Soon I have a tested version I reach you back.

Changed in net-snmp (Ubuntu):
assignee: nobody → Leonidas S. Barbosa (leosilvab)
status: New → In Progress
Revision history for this message
Leonidas S. Barbosa (leosilvab) wrote :

A new version is available building in security-proposed: https://launchpad.net/~ubuntu-security-proposed/+archive/ubuntu/ppa/+packages - 5.7.3+dfsg-1.8ubuntu3.6. It would be appreciate any tests on it.

Using the new flag -cacheTime is set in /etc/snmp/snmpd.conf , extend -cacheTime -1 ...
After restart snmpd run snmpwalk -v1 -c test localhost "NET-SNMP-EXTEND-MIB::nsExtendCacheTime" must show the value was set.

Issue was not reproducible in a VM, probably some issues with NIC. It was in a docker.

Thanks!

Revision history for this message
azrle (azrlew) wrote :

Thanks for the quick fix!

After some tests, I believe that 5.7.3+dfsg-1.8ubuntu3.6 will fix the issue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.7.3+dfsg-1.8ubuntu3.6

---------------
net-snmp (5.7.3+dfsg-1.8ubuntu3.6) bionic-security; urgency=medium

  * SECURITY REGRESSION: The update for CVE-2020-15862 making mib extend
    read-only caused nsExtendCacheTime to be not setable anymore (LP: #1892980)
    - debian/patches/CVE-2020-15862-bug1893465.patch: add -cacheTime and
      -execType flags to "extend" config directive in
      agent/mibgroup/agent/extend.c, man/snmpd.conf.5.def.

 -- <email address hidden> (Leonidas S. Barbosa) Fri, 28 Aug 2020 17:14:41 -0300

Changed in net-snmp (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.7.3+dfsg-1ubuntu4.6

---------------
net-snmp (5.7.3+dfsg-1ubuntu4.6) xenial-security; urgency=medium

  * SECURITY REGRESSION: The update for CVE-2020-15862 making mib extend
    read-only caused nsExtendCacheTime to be not setable anymore (LP: #1892980)
    - debian/patches/CVE-2020-15862-bug1893465.patch: add -cacheTime and
      -execType flags to "extend" config directive in
      agent/mibgroup/agent/extend.c, man/snmpd.conf.5.def.

 -- <email address hidden> (Leonidas S. Barbosa) Mon, 31 Aug 2020 09:46:19 -0300

Changed in net-snmp (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.