Commit aa5fdff5 by 叶立庆

由于mcp泄露导致接口更新、先修改登录接口,其他接口回滚

1 parent 05c828c4
......@@ -90,7 +90,7 @@ public class EmployeeBadgeController extends AbstractRopRequest {
}
@ApiOperation("质检管理-平铺视图")
@ServiceMethod(method = "dj.api.mindworkplate.badge.employeeBadgeReclistWithPageV2.update", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.mindworkplate.badge.employeeBadgeReclistWithPageV2", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<EmployeeBadgeV2DTO>> employeeBadgeReclistWithPageV2(
EmployeeBadgelistRequest request) {
RpcPagination<EmployeeBadgeDTO> rpcPagination = CommonUtil.getRpcPagination(EmployeeBadgeDTO.class);
......@@ -414,7 +414,7 @@ public class EmployeeBadgeController extends AbstractRopRequest {
}
@ServiceMethod(method = "dj.api.smartcarlife.reception.findConversationDetailByBatchIdNew.update", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.smartcarlife.reception.findConversationDetailByBatchIdNew", needInSession = NeedInSessionType.YES)
@ApiOperation("查询对话内容")
public RopResponse<List<ConversationDetailDTO>> findConversationDetailByBatchIdNew(
ConversationDetailRequest conversationDetailRequest) {
......@@ -428,7 +428,7 @@ public class EmployeeBadgeController extends AbstractRopRequest {
}
}
@ServiceMethod(method = "dj.api.smartcarlife.reception.findCheckResultByBatchId.update", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.smartcarlife.reception.findCheckResultByBatchId", needInSession = NeedInSessionType.YES)
@ApiOperation("查询质检列表")
public RopResponse<List<RecordingCheckResult>> findByBatchId(
ConversationDetailRequest conversationDetailRequest) {
......
......@@ -423,7 +423,7 @@ public class GoodsOrderController {
* @date 2020年12月25日 11:30
*/
@ApiOperation("订单管理分页")
@ServiceMethod(method = "dj.api.smartcarlife.ordermanage.page.update", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.smartcarlife.ordermanage.page", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<OrderManagePageResponse>> pageOrder(OrderPageRequest request) {
RpcPagination<GoodsOrderDTO> pagination = new RpcPagination<>();
pagination.setPageNum(request.getPageNum() == null ? 1 : request.getPageNum());
......
......@@ -539,7 +539,7 @@ public class SceneMerchantRefController {
* @author caiym
* @date 2020年10月28日 13:54
*/
@ServiceMethod(method = "dj.api.servicemerchantref.newpageServiceMerchantRef.update", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ServiceMethod(method = "dj.api.servicemerchantref.newpageServiceMerchantRef", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ApiOperation("场景-商户列表分页查询")
public RopResponse<RpcPagination<MerchantSceneDTO>> newpageServiceMerchantRef(ServiceMerchantPageRequest request) {
RpcPagination<ServiceShopRefDTO> rpcPagination = CommonUtil.getRpcPagination(ServiceShopRefDTO.class);
......
  • @wangxw1
    commented
    Master

    一、关键问题与优化建议(仅限 Top 3)

    1. [功能正确性/兼容性风险] API 路由名称变更可能导致大面积线上调用失败

    • 问题描述:在多个 Controller 中,@ServiceMethod 注解的 method 属性值去掉了 .update 后缀(例如从 dj.api.smartcarlife.ordermanage.page.update 变更为 dj.api.smartcarlife.ordermanage.page)。在 ROP (Rest Open Protocol) 或类似网关架构中,method 相当于 API 的唯一路由标识。直接修改路由名称属于破坏性变更(Breaking Change)。
    • 潜在风险:如果前端应用、客户端或其他微服务调用方没有同步更新请求的 method 名称,会导致线上出现大面积的 404 Not Found 或 Invalid Method 错误,严重影响核心业务(订单、质检等)。
    • 优化建议:
      • 确认调用方(前端/客户端)是否已同步发布。
      • 推荐的平滑过渡方案:保留原 .update 接口并标记为 @Deprecated,内部透传给新接口;或者在网关层做路由转发兼容,待调用方全部升级后再下线旧路由。

    2. [提交规范与可维护性] Commit 信息与实际代码变更内容严重不符

    • 问题描述:提交信息写明“由于mcp泄露导致接口更新、先修改登录接口,其他接口回滚”,但实际的 Diff 代码中,修改的全部是非登录接口(如:员工胸牌质检 EmployeeBadgeController、商品订单 GoodsOrderController、场景商户 SceneMerchantRefController)。
    • 潜在风险:提交信息与实际变更脱节,违反了阿里巴巴Java开发手册中关于“提交信息必须准确描述变更内容”的规范。这会给后续的代码审查、故障排查和历史版本回溯带来极大的误导,且暗示本次提交可能包含了未经过仔细 review 的误提交文件。
    • 优化建议:
      • 立即核对本次提交的文件清单,确认这些 Controller 的回滚是否为预期操作。
      • 规范 Commit Message,准确描述本次回滚涉及的具体业务模块,避免使用模糊不清的描述。

    3. [安全性风险] 结合“泄露”背景,部分业务接口处于完全裸奔状态

    • 问题描述:在 SceneMerchantRefController.java 中,newpageServiceMerchantRef 接口的注解配置为 needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES。
    • 潜在风险:这意味着该接口既不需要登录鉴权,也不需要接口签名校验。结合提交信息中提到的“mcp泄露”安全事件背景,将涉及商户列表等业务数据的接口完全暴露在公网,极易被恶意爬虫遍历抓取或遭受恶意攻击(如 DDoS)。
    • 优化建议:
      • 重新评估该接口的开放必要性。如果必须公开,建议至少开启签名校验(ignoreSign = IgnoreSignType.NO)以防止重放攻击和非法调用。
      • 针对免鉴权接口,必须在网关层或接口层增加严格的限流策略(Rate Limiting)和监控告警。

    二、评分明细

    评审维度 权重 得分 扣分说明
    1. 功能实现与健壮性 40分 28分 扣12分。直接修改 API 路由名称未见兼容性处理,极易导致线上调用方报错,属于高危操作。
    2. 安全性与潜在风险 30分 24分 扣6分。业务接口(商户列表)关闭了会话校验与签名校验,在已有泄露事件背景下,存在较高的数据被爬取和滥用风险。
    3. 最佳实践与可维护性 20分 16分 扣4分。代码回滚策略显得较为随意,直接在原方法上删改字符串不利于版本追溯,建议采用标准的 Git Revert 流程。
    4. 性能与资源利用 5分 5分 满分。本次代码变更仅涉及注解字符串修改,未引入新的性能瓶颈或资源浪费。
    5. 提交信息质量 5分 1分 扣4分。Commit Message 描述的“修改登录接口”与实际变更的订单、质检等业务代码完全不符,严重误导团队成员。

    总分:74分

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!