Skip to content

fix(web-common): add check for possible unsafe json parse#6589

Merged
maryliag merged 4 commits intoopen-telemetry:mainfrom
maryliag:parse-local-storage
Apr 14, 2026
Merged

fix(web-common): add check for possible unsafe json parse#6589
maryliag merged 4 commits intoopen-telemetry:mainfrom
maryliag:parse-local-storage

Conversation

@maryliag
Copy link
Copy Markdown
Contributor

localStorage data can be tampered with by other scripts on the same origin. Malformed data crashes the call.

@maryliag maryliag requested review from a team as code owners April 13, 2026 16:21
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.76%. Comparing base (36ce569) to head (226bf37).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6589   +/-   ##
=======================================
  Coverage   95.75%   95.76%           
=======================================
  Files         375      375           
  Lines       12725    12727    +2     
  Branches     3013     3013           
=======================================
+ Hits        12185    12188    +3     
+ Misses        540      539    -1     
Files with missing lines Coverage Δ
...ackages/web-common/src/LocalStorageSessionStore.ts 93.75% <100.00%> (+8.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@david-luna david-luna left a comment

Choose a reason for hiding this comment

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

@maryliag thakns for catching that unwanted scenario. Please remove the it.only so the full test suite runs and it's good to go :)

@maryliag
Copy link
Copy Markdown
Contributor Author

@david-luna ooops (now you know how I'm running the new tests hehe)
only removed

@maryliag maryliag enabled auto-merge April 14, 2026 15:22
@maryliag maryliag added this pull request to the merge queue Apr 14, 2026
Merged via the queue into open-telemetry:main with commit 8ee2a8b Apr 14, 2026
27 checks passed
@maryliag maryliag deleted the parse-local-storage branch April 14, 2026 15:51
maryliag added a commit to maryliag/opentelemetry-js that referenced this pull request Apr 17, 2026
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