Skip to content
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

cannot invalidate application tokens #5001

Closed
1 of 4 tasks
disconn3ct opened this issue Apr 28, 2024 · 6 comments
Closed
1 of 4 tasks

cannot invalidate application tokens #5001

disconn3ct opened this issue Apr 28, 2024 · 6 comments
Labels
bug Issue describes a bug bugfix release relevant Issue should be looked at for backporting into the next bugfix release done Done but not yet released
Milestone

Comments

@disconn3ct
Copy link

The problem

Users cannot invalidate application tokens

Did the issue persist even in safe mode?

Yes, it did persist

If you could not test in safe mode, please state why ("currently printing" is NOT an excuse!)

No response

Version of OctoPrint

1.10.0

Operating system running OctoPrint

dietpi

Printer model & used firmware incl. version

No response

Browser and version of browser, operating system running browser

No response

Checklist of files to include below

  • Systeminfo Bundle (always include!)
  • Contents of the JavaScript browser console (always include in cases of issues with the user interface)
  • Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
  • GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)

Additional information & file uploads

2024-04-28 11:02:45,911 - octoprint.server.api - ERROR - Error while executing SimpleApiPlugin appkeys
Traceback (most recent call last):
File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.11/site-packages/octoprint/server/api/init.py", line 162, in pluginCommand
response = api_plugin.on_api_command(command, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.11/site-packages/octoprint/util/init.py", line 1686, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.11/site-packages/octoprint/plugins/appkeys/init.py", line 381, in on_api_command
if user_for_key is None or user_for_key.user_id != user_id:
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'User' object has no attribute 'user_id'

@github-actions github-actions bot added the triage This issue needs triage label Apr 28, 2024
@disconn3ct
Copy link
Author

This is probably a security issue in truth, but the barrier to entry is pretty high.

@jneilliii
Copy link
Contributor

I am unable to reproduce this issue, where in the system are you pressing the delete key on the application key?

@disconn3ct
Copy link
Author

disconn3ct commented Apr 29, 2024

Username to User Settings to Application Keys. Click the trash icon and it pops up with the confirmation. Clicking 'proceed' results in a 500
image

The user is not an administrator (operator only). It looks like the administrator/initial user can delete tokens successfully.

(Edit to add: Sorry for the delay. The robot strongly hinted a human was not going to review this so I didn't check in.)

@foosel foosel added bug Issue describes a bug and removed triage This issue needs triage labels Apr 29, 2024
@foosel foosel added this to the 1.10.x milestone Apr 29, 2024
@foosel foosel added the bugfix release relevant Issue should be looked at for backporting into the next bugfix release label Apr 29, 2024
@foosel
Copy link
Member

foosel commented Apr 29, 2024

Logged in as a user I can reproduce this. There must have gone something wrong during a refactoring.

@foosel
Copy link
Member

foosel commented Apr 29, 2024

Fix is ready for 1.10.1 (even though the build currently fails for other reasons).

@foosel foosel added the done Done but not yet released label Apr 29, 2024
@foosel foosel closed this as completed in fd0023a May 14, 2024
@disconn3ct
Copy link
Author

Confirmed working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a bug bugfix release relevant Issue should be looked at for backporting into the next bugfix release done Done but not yet released
Projects
Status: Done
Development

No branches or pull requests

3 participants