Skip to content

chore: update changelog to 6.1.91#1121

Merged
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
mhduiy:dev-changelog-6.1.91
May 22, 2026
Merged

chore: update changelog to 6.1.91#1121
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
mhduiy:dev-changelog-6.1.91

Conversation

@mhduiy
Copy link
Copy Markdown
Contributor

@mhduiy mhduiy commented May 22, 2026

更新说明

自动更新 changelog 到版本 6.1.91

变更内容

  • 更新 debian/changelog

版本信息

  • 新版本: 6.1.91
  • 目标分支: master

Summary by Sourcery

Documentation:

  • Refresh Debian changelog entries to document version 6.1.91.

update changelog to 6.1.91

Log: update changelog to 6.1.91
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 22, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Debian changelog to reflect a new package version 6.1.91 for the master branch, with no other code or configuration changes.

File-Level Changes

Change Details Files
Update Debian changelog entry for new release version 6.1.91
  • Add or modify the top changelog stanza to set the version to 6.1.91
  • Ensure the changelog conforms to Debian formatting conventions
  • Align the recorded target branch/release information with master
debian/changelog

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

TAG Bot

TAG: 6.1.91
EXISTED: no
DISTRIBUTION: unstable

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

你好!我是CodeGeeX。我已仔细审查了你提供的Git Diff记录。

从Diff内容来看,这是一个Debian changelog的更新,记录了 dde-daemon 版本升级至 6.1.91,并且包含了一个重要的安全修复:禁用 SetPassword DBus 方法并防止 chpasswd 注入

由于本次Diff仅包含 debian/changelog 的变更,没有涉及实际的代码(如 .go, .c.py 文件)修改,我无法直接对语法逻辑、代码性能等进行直接的代码级审查。但是,基于这个Commit Message所描述的安全修复意图,我将为你提供针对“防止 DBus 提权与 chpasswd 注入”这一场景的深度审查意见和代码改进建议。


一、 代码安全

本次修复的核心是安全,针对“SetPassword DBus 方法”和“chpasswd 注入”,以下是关键的安全审查点和改进意见:

  1. DBus 接口暴露风险

    • 问题:在Linux桌面环境中,DBus常常是提权攻击的突破口。如果 SetPassword 方法通过系统总线暴露,且没有严格的权限校验,任何普通用户进程都可能调用它来修改其他用户或root的密码。
    • 改进意见
      • 彻底禁用:如果该方法不再需要,直接从DBus XML定义中移除,并在代码中删除对应的处理函数(这是最安全的做法,与changelog描述一致)。
      • 权限策略:如果因为历史兼容性不能完全移除,必须在DBus的 .policy 文件中严格限制,例如只允许 root 用户或特定的系统服务调用:
        <!-- 仅允许root调用 -->
        <policy user="root">
          <allow send_destination="com.deepin.daemon.Accounts" send_interface="com.deepin.daemon.Accounts.User" send_member="SetPassword"/>
        </policy>
        <policy context="default">
          <deny send_destination="com.deepin.daemon.Accounts" send_interface="com.deepin.daemon.Accounts.User" send_member="SetPassword"/>
        </policy>
  2. chpasswd 命令注入漏洞

    • 问题chpasswd 是一个通过标准输入接收 用户名:密码 格式来批量修改密码的命令。如果之前的代码是通过 os/execpopen 拼接字符串来调用它(例如:echo "user:pass" | chpasswd),攻击者可以通过在用户名或密码中注入换行符和特殊字符来执行任意命令或修改其他用户的密码。
    • 改进意见
      • 绝对不要使用 Shell 拼接:禁止使用 bash -c "echo ..." 或类似方式。
      • 使用安全的系统调用/PAM:最安全的做法是不调用外部命令,而是直接调用系统底层的 PAM (Pluggable Authentication Modules) API 或 C 标准库的 crypt() 函数修改 /etc/shadow
      • 安全的 chpasswd 调用方式:如果必须使用 chpasswd,务必通过管道安全地传递参数,并对输入进行严格校验。

二、 语法逻辑

如果原代码存在注入漏洞,其逻辑通常存在缺陷。以下是修复时应遵循的逻辑规范:

  1. 输入校验逻辑

    • 在处理密码修改的逻辑中,必须对用户名和密码进行严格的白名单校验。
    • 用户名:只允许字母、数字、下划线和短横线,绝不允许包含换行符 \n、冒号 : 或空格。
    • 密码:虽然密码可以包含特殊字符,但必须过滤换行符 \n,防止在通过管道传递给 chpasswd 时发生行截断注入。
  2. 错误处理逻辑

    • 如果检测到非法输入(如包含换行符),应立即中断操作并返回错误,而不是尝试清理后继续执行。

三、 代码质量

  1. 废弃标记

    • 如果 SetPassword 方法在旧版本的客户端中仍可能被调用,建议在代码中保留该方法的空壳,并添加明确的废弃注释,同时记录错误日志,而不是直接删除导致DBus调用返回异常崩溃。
  2. 日志审计

    • 对于密码修改这种高危操作,无论成功与否,都应有详细的审计日志记录(调用者UID、目标用户、时间、成功/失败原因),但绝对不能将明文密码写入日志

四、 代码性能

密码修改操作属于极低频操作,性能通常不是核心考量,但以下两点值得注意:

  1. 避免频繁重启服务:如果禁用DBus方法是通过修改配置文件实现的,确保DBus服务端支持配置热加载,而不是每次修改都需要重启 dde-daemon
  2. 加密算法开销:如果弃用了外部命令 chpasswd 而改用程序内计算哈希(如 SHA-512 或 yescrypt),需注意这些算法故意设计得较慢(抗暴力破解)。在并发请求下,大量计算可能会短暂占用CPU,建议对单个用户的密码修改操作加读写锁。

附:安全修复代码示例

如果你的项目是使用 Go 语言编写的(dde-daemon 的常见开发语言),以下是不安全安全的代码对比,供你参考实际代码修改是否符合安全规范:

❌ 不安全的代码(存在 chpasswd 注入)

import "os/exec"

func SetPassword(username, password string) error {
    // 严重漏洞:如果 username 或 password 包含换行符或特殊字符,会导致注入
    // 例如 password = "root:hackpass\nuser:hackpass"
    cmd := exec.Command("bash", "-c", fmt.Sprintf("echo '%s:%s' | chpasswd", username, password))
    return cmd.Run()
}

✅ 安全的代码(使用管道传递,无 Shell 拼接,并校验输入)

import (
    "bytes"
    "fmt"
    "os/exec"
    "regexp"
)

func SetPassword(username, password string) error {
    // 1. 严格校验用户名,防止注入
    validUsername := regexp.MustCompile(`^[a-zA-Z0-9_-]+$`)
    if !validUsername.MatchString(username) {
        return fmt.Errorf("invalid username format")
    }

    // 2. 检查密码中是否包含换行符,防止 chpasswd 行截断
    if bytes.ContainsAny([]byte(password), "\n\r") {
        return fmt.Errorf("invalid password format: contains newline characters")
    }

    // 3. 安全调用 chpasswd:不通过 shell 拼接,直接通过 Stdin 管道写入
    cmd := exec.Command("chpasswd")
    cmd.Stdin = bytes.NewBufferString(fmt.Sprintf("%s:%s", username, password))
    
    output, err := cmd.CombinedOutput()
    if err != nil {
        return fmt.Errorf("chpasswd failed: %s, error: %v", string(output), err)
    }
    return nil
}

总结:你的 Changelog 提到了一个非常关键的安全修复。建议在实际的代码提交中,确保不仅禁用了 DBus 接口,还彻底清除了底层可能引发 chpasswd 注入的字符串拼接逻辑,并增加了严格的输入校验。如果需要我进一步审查具体的代码变更,请提供对应的 .go.c 文件的 Diff!

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy, xionglinlin

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@xionglinlin xionglinlin merged commit b098062 into linuxdeepin:master May 22, 2026
17 of 19 checks passed
@deepin-bot
Copy link
Copy Markdown
Contributor

deepin-bot Bot commented May 22, 2026

TAG Bot

Tag created successfully

📋 Tag Details
  • Tag Name: 6.1.91
  • Tag SHA: 3817d31c55a397b2475cee6076141eec3d374dbf
  • Commit SHA: 40e3eae43bb7d1052fe888a882b78820873bee87
  • Tag Message:
    Release dde-daemon 6.1.91
    
    
  • Tagger:
    • Name: mhduiy
  • Distribution: unstable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants