Skip to content

Conversation

@valkirilov
Copy link
Member

@valkirilov valkirilov commented Jan 28, 2026

What

Update JSON parser configuration to allow constructor and __proto__ properties to be preserved during JSON parsing

Note: Since RedisInsight displays arbitrary user data from Redis, is it safe to do so?

Reference #5412

Testing

  1. Create a JSON key with such proprietary values
JSON.SET mykey $ '{"constructor":"example value"}'
  1. Try to open the key on the Browser page
Before After
image image

Note

Ensures JSON values with potentially dangerous property names are preserved when reading from RedisJSON.

  • Configure JSONBigInt in rejson-rl.service.ts with protoAction: 'preserve' and constructorAction: 'preserve'
  • Add unit tests in rejson-rl.service.spec.ts verifying handling of constructor, "__proto__" (as raw string), and nested occurrences during getJson

Written by Cursor Bugbot for commit 23ebeab. This will update automatically on new commits. Configure here.

- updat JSONbig configuration to allow "constructor" and "__proto__" properties to be preserved during JSON parsing

re #RI-7973
@valkirilov valkirilov self-assigned this Jan 28, 2026
@github-actions
Copy link
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.42% 13988/15136
🟡 Branches 74.42% 4280/5751
🟢 Functions 86.01% 2151/2501
🟢 Lines 92.23% 13375/14502

Test suite run success

3017 tests passing in 288 suites.

Report generated by 🧪jest coverage report action from 23ebeab

@github-actions
Copy link
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟢 Statements 81.51% 16351/20059
🟡 Branches 64.6% 7424/11491
🟡 Functions 70.4% 2289/3251
🟢 Lines 81.15% 15385/18958

@valkirilov valkirilov marked this pull request as ready for review January 28, 2026 08:11
@valkirilov valkirilov changed the title RI-7973) Enhance JSON parse to safely handle prototype pollution RI-7973 Enhance JSON parse to safely handle prototype pollution Jan 28, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

We have had 2 CVEs in the last couple of months related to loose parsing of user data - React Server Components and N8N, both of them allowed arbitrary code execution because of interpreting strings (JSON) as javascript. Therefore, my opinion is that ANY parsing of JS keywords (such as constructor) should be avoided

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.

4 participants