getsentry / getsentry/sentry-java

Session seq is raw epoch millis; duration is masked with Math.abs

未关闭
#5,580 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Platform: Java
主要语言
Kotlin
星标
1.4k
派生
478
平均合并
2 天 23 小时
30 天内合并 PR
67

描述

Audit finding **C2 — theoretical, LOW-MEDIUM**.

`Session` uses raw epoch millis for `seq` and `Math.abs` for duration (`sentry/src/main/java/io/sentry/Session.java`):

* `seq` is set from `getSequenceTimestamp()`, which returns `timestamp.getTime()` (raw epoch millis) — `Session.java:309`, invoked from the session-update path at `:227`. A backward clock step between updates → the newer update has a smaller `seq` → the server can discard the latest session state (lost end/error counts).
* `calculateDurationTime` uses `Math.abs``(timestamp.getTime() - started.getTime())` (`Session.java:240`), which masks negative durations rather than surfacing them.

Source: [JAVA-557]() §C2.

贡献指南

打开贡献指南

调研方向

Read sentry/src/main/java/io/sentry/Session.java, especially the session-update path around line 227, calculateDurationTime around line 240, and getSequenceTimestamp around line 309. Trace how clock changes affect sequence ordering and duration handling, then identify the relevant existing tests or test entry points. Done means the reported clock-step cases are handled without losing newer session state or masking negative durations.

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
observability
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。