-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A cache of securityStateReference will not be popped when error situation happens without the reportableFlag for SNMPv3. #93
Comments
It took us a while to validate this and confirm the results you provided. Can you create a pull request so that we can merge your fix? |
Thank you for validating my fix. Sure, I can do that. Please wait a while for me to make the request. By the way, I have found additional similar potential issues as follows. I would like to include the additional fixes in the request as well. Is that okay?
|
Sure. Please feel free to include all changes you suggest. We will review them all together. |
Fixed in #143. Further conversation will go on there. |
…ence. See #93 for details." This reverts commit 144d42cd9893735f30097bfb822350c7cb3c990c.
Expected behavior
I expect the cache will be popped as follows.
Actual behavior
My snmp trap receiver using pysnmp library received a SNMPv3 trap message having invalid password for authentication without the reportableFalg.
The cache for securityStateReference was not popped properly and the memory of the trap receiver was getting increased.
Following is my analysis of the behavior.
prepareDataElement() in proto/mpmod/rfc3412.py calls processIncomingMsg() in proto/secmod/rfc3414/service.py.
processIncomingMsg() pushes a cache to create a message to report later.
And then, the authenticationFailure exception raises because of the invalid password.
prepareDataElement() calls returnResponsePdu() in proto/rfc3412.py to report the error to the sender of the trap.
returnResponsePdu() calls prepareResponseMessage() in proto/mpmod/rfc3412.py.
prepareResponseMessage() is terminated at the following location without sending the message to report because the reportableFlag is 0.
So, nobody pops the securityStateReference chache, the cache will be accumulated and the memory of the trap receiver will be increased.
Detailed steps
Following is the detailed steps.
Invalid Engine ID.
Invalid security name.
Invalid password for authentication.
Invalid password for privacy.
Note:
The problem does not happen under the following conditions.
Python package information
pysnmp 6.2.4
Operating system information
Red Hat Enterprise Linux release 9.2
Python information
python 3.9
(Optional) Contents of your test script
Relevant log output
The text was updated successfully, but these errors were encountered: