Incorrect Log entry - Export entity, user_archive

AI-generated summary

A user, Biscuit, reported an incorrect log entry labeling a non-staff user as “Staff User” during an “export entity” action with subject “user_archive”. This caused concern that a non-staff member might have gained elevated permissions. codinghorror clarified that any user can export their own posts via their user page — a feature since Discourse 1.1 — and the log’s “Staff User” label is misleading. Biscuit confirmed the confusion stemmed from the label and the unclear term “user_archive”. codinghorror suggested the issue may lie in logging code added by techAPJ, though techAPJ credited vinothkannans for the original implementation. codinghorror acknowledged the mislabeling. Mittineague proposed changing the log column header “Staff User” to simply “User”, noting that non-staff actions (like username changes) are already logged. jomaxro agreed. techAPJ confirmed the fix was implemented, changing the label to “User” in this commit.

We have a log entry for:

Staff User: [Users Name]
Action: export entity
Subject: user_archive

The user listed is not actually a staff member, so the log is incorrect in that regard. It’s a new user who just signed up.

Also, what specific user action triggers that log entry as I haven’t seen it before?

What’s weird about it? Any user can export all their posts / topics directly from their user page. This has existed as a default option for users since Discourse 1.1 as I recall.. try it yourself.

1 Like

Hey Jeff, the weird part is that the discourse logs list the user as being “staff user”, when they’re not staff. This concerned me as I thought some user had somehow gained staff rights, like admin or mod. I wondered if we had been hacked. But it looks like Discourse is just incorrectly describing the user as staff.

And because I saw the subject “user archive” and didn’t know exactly what that refers to, I was concerned that someone with staff-level rights had exported the forums full user list. Hense my question about what that log entry references.

That’s all. LOL.

I see. This may be @techapj’s bug? We added logging to exports and this might be in that code path.

2 Likes

This feature was actually added by @vinothkannans in:

https://github.com/discourse/discourse/commit/9281b72308c7844396d41d67d61305b93d148236

2 Likes

Ah yes my bad @vinothkannans probably your bug. Not all exports are staff…

2 Likes

I don’t know as I would call it a bug instead of outdated UI - unless there are plans to have a non-staff logs page.

To me there is no confusion between user_list and user_archive. What is incorrect is the left column head text - “Staff User”. I think the easy fix would be to simply change that (and the filter label) to “User”.

5 Likes

Agree with @Mittineague here. We log other non-staff actions like username changes. A header change seems simplest.

4 Likes

Done via:

https://github.com/discourse/discourse/commit/2a94bf9dfb84e8fbd1aeaa5f3aa8dc34cf90e0d8

7 Likes