Skip to content

LINE/Security: harden inbound media temp-file naming - #20792

Merged
mbelinky merged 2 commits into
mainfrom
hardening/line-temp-path-uuid
Feb 19, 2026
Merged

mbelinky merged 2 commits into
mainfrom
hardening/line-temp-path-uuid

Conversation

@mbelinky

@mbelinky mbelinky commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary\n- harden LINE media download temp path generation to avoid deriving filenames from external message IDs\n- add regression tests proving traversal-style message IDs cannot influence the write path\n\n## Motivation\n- follow-up hardening after GHSA-vj3g-5px3-gr46 (Feishu traversal fix), scoped as proactive defense-in-depth\n\n## Testing\n- pnpm exec vitest run src/line/download.test.ts\n

Greptile Summary

Hardens LINE media download against path traversal vulnerabilities by replacing external message IDs with cryptographically random UUIDs in temp file paths. The fix introduces buildLineTempMediaPath() that combines Date.now() and crypto.randomUUID() to generate safe temp filenames, preventing attackers from using crafted message IDs like ../../../../etc/passwd to write files outside the temp directory. This follows the same defense-in-depth approach applied to Feishu in commit c821099.

Key changes:

  • Replaced line-media-${messageId}-${Date.now()} pattern with line-media-${Date.now()}-${crypto.randomUUID()}
  • Added comprehensive regression tests verifying traversal-style message IDs cannot escape temp directory
  • Maintained all existing functionality while eliminating the security risk

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a focused security hardening fix with comprehensive test coverage
  • The fix directly addresses a path traversal vulnerability using industry-standard mitigation (crypto.randomUUID). The implementation is simple, well-tested with edge cases including traversal attempts, and follows the same pattern already proven effective in the Feishu fix. The change is minimal and surgical, affecting only the temp path generation logic without touching business logic or data flow.
  • No files require special attention

Last reviewed commit: 0f30c21

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Feb 19, 2026
@mbelinky
mbelinky force-pushed the hardening/line-temp-path-uuid branch from 0f30c21 to 4ca9f7b Compare February 19, 2026 09:35
@mbelinky
mbelinky force-pushed the hardening/line-temp-path-uuid branch from 4ca9f7b to f6f3eec Compare February 19, 2026 09:37
@mbelinky
mbelinky merged commit 8e6d1e6 into main Feb 19, 2026
9 checks passed
@mbelinky
mbelinky deleted the hardening/line-temp-path-uuid branch February 19, 2026 09:37
@mbelinky

Copy link
Copy Markdown
Contributor Author

Merged via maintainer PR flow.

What was done:

  • Rebased and prepared PR head on latest main
  • Passed gates (pnpm build, pnpm check, pnpm test)
  • Landed hardening change + regression tests + changelog entry

SHAs:

  • Prepared PR head: f6f3eecdb3ce21ccdccd8b2c10a74ebd47ad809e
  • Merge commit on main: 8e6d1e636821141349da4f9d96fcc3c924449c8e

Copilot AI added a commit to mf-yang/openclaw-cn that referenced this pull request Feb 20, 2026
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6f3eec
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
mf-yang added a commit to mf-yang/openclaw-cn that referenced this pull request Mar 1, 2026
…penclaw#20792) (#235)

* Initial plan

* LINE/Security: harden inbound media temp-file naming (port upstream openclaw#20792)

Co-authored-by: jiulingyun <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jiulingyun <[email protected]>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6f3eec
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6f3eec
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6f3eec
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6f3eec
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant