PMs are accesible by admins if the admin has the link

I just found out that if someone sends a PM to other person. Let’s say from account joe to jane, and for some reason someone (logged in) finds out the right “topic ID” it can read the PM.

I know is kinda a edge-case and is rather difficult to find out, but automating some kind of scraper to cicle trough all the topics ID anyone could read all the PMs.

I found out because a user replied to the notification email, and I was able to click the link and read the PM in question.

I’m assuming you are a staff member on the forum? You should only be able to do this if you are staff. Staff should have the ability to audit PMs by default, and admins and those with access to the DB would have access to the raw messages anyway.

If you’re needing to provide a truly private system, there is the discourse-encrypt plugin which provides end-to-end encryption of messages.

9 个赞

It’s not a necessity, just didn’t got a thought in that one.

I’ll test with a normal account and update this, just in case.

1 个赞

This is only true for admins, not moderators, so I am editing your title which is incorrect. Moderators also only have access to PMs when they are flagged.

If this is a concern, demote yourself to moderator (by logging in under a different account to taste), or enable logging of PM visits by admins in your site settings.

5 个赞

可能是个愚蠢的问题——这个设置到底在哪里?我们在使用稳定版(理论上应该有这个开关),但我怎么也找不到。

编辑: 我们的另一位管理员找到了它——它在“用户”选项卡下的“log personal messages views”(记录个人消息查看)。我认为这应该放在“安全”选项卡下,但如果仔细想想,也能理解为什么它会放在那里。

2 个赞

跟进问题 - 是否可以在管理员查看了某个账户的消息(即使他们没有打开消息阅读其内容)时启用日志记录?

在我们的论坛环境中,管理员有可能滥用他们的权力,仅仅通过查看某些用户可能参与的私人消息的详细信息——阅读其内容不一定比知道名称以及哪些用户有权访问更具破坏性,而后者尽管启用了该设置,目前仍未被记录。理想情况下,我们希望修复此问题,并记录管理员何时查看了用户参与的消息,而不仅仅是何时查看了特定消息的内容。

1 个赞

最好的方法是使用端到端加密,这可以通过我们的 discourse-encrypt 插件实现。

管理员是论坛的管理员,可以访问所有数据。管理员有很多方法可以在不记录的情况下查看消息内容:

  • 下载备份
  • 数据浏览器
  • 冒充
  • 创建 API 密钥

要全面保护用户,最佳解决方案是使用加密消息。如果您不信任您的管理员,他们就不应该是管理员。

5 个赞

我的理解是,这些大部分都可以记录,这正是我们所需要的——说实话,我不确定我是否能相信自己不会无意中查看用户的消息页面然后就好像什么都没发生一样继续下去,这在我们这里可能会造成危害(特别是,我们不认为这会是安全风险,而是完整性风险——也就是说,只要获得这些知识的用户公开此事并回避相关话题,就不会造成长期损害)。

如果这些事情被记录下来,就像他们可以访问相同数据的其他方式一样,那肯定会更容易确保没有人会无意或有意地这样做而不进行报告。

如果你列出的那些东西不能被记录,那它们就应该被记录,但即便如此,这也只能对付恶意的管理员,而不能对付稍微粗心的管理员。

1 个赞

您可以使用站点主题隐藏/模糊其他用户消息列表中的消息标题。

如果是故意的,那是另一回事。

您还可以从其他地方获取此审核信息:Web 服务器日志。

我相信记录此信息的插件不会很难,但不确定这是否应该在我们内部的路线图上。

2 个赞

如何在不模糊自己的消息列表的情况下实现这一点?据我所知,没有用户名这样的标识符可以用于您正在查看的帐户,以便仅使用 CSS 影响非您自己的消息页面。

1 个赞

您或许可以使用页面上的标题选择器——“Messages”是您的,“Username — Messages”是别人的。

2 个赞

我的主要问题是我的脚本似乎在数据更新之前就将其提取出来了——也就是说,我可以在页面更改时读取元数据,但它会在页面数据更新之前更新。

<script type="text/discourse-plugin" version="0.8">
    api.onPageChange(() => {
        window.onload = determineUser();
    });
    
    function determineUser() {
        var pageURL = document.querySelector("meta[property='og:url']").getAttribute("content");
        var userPage = pageURL.includes("https://www.fortressoflies.com/u/");
        document.documentElement.style.setProperty('--currUsername', pageURL);
        
        if(userPage)
        {
            document.documentElement.style.setProperty('--lastUsername', pageURL);
        }
    }
</script>

基本上,我的 --currUsername 被更新了,然后元标签用新的 url 更新,所以我的 --currUsername 总是比我实际查看的页面落后一页。无论我是否使用“window.onload”行,都会发生这种情况。

有什么办法可以解决这个问题吗?

最终目标基本上是根据你正在查看的页面向 body 添加一个类,然后基于此进行样式设置——例如,这将允许我们读取该 title 字段而不是 og:url 字段,然后在此实例中添加一个“myMessages”类到 body 以获得期望的效果。理论上。

1 个赞

极其粗糙,但以下方法似乎通过强制 JavaScript 函数延迟 1/20 秒来起作用:


    api.onPageChange(() => {
        window.onload = determineUser();
    });

    async function determineUser() {
        await sleep(50);
        var pageURL = document.querySelector("meta[property='og:url']").getAttribute("content");
        var userPage = pageURL.includes("https://www.fortressoflies.com/u/");
        document.documentElement.style.setProperty('--currUsername', pageURL);
        if (userPage)
        {
            document.documentElement.style.setProperty('--lastUsername', pageURL);
        }
    }

    function sleep(ms)
    {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

看看我是否能让它按预期工作。

2 个赞