[SERVER-36404] js bson integration should support a per object js protection flag Created: 01/Aug/18  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: former-quick-wins, move-sa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-40425 fix Object.extend() for all custom ja... Backlog
Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

 
load('jstests/libs/parallelTester.js');
 
var x = NumberLong("1000");
 
print(tojson(x));
 
var thread = new Thread(function(s) {
  print(tojson(s));
}, x);
thread.start();
thread.join();

Participants:

 Description   

Currently, we hard pivot between bson code values and js functions with the global isJavaScriptProtectionEnabled() function.  To workaround passing functions between threads (in ScopedThread) we manually walk objects and eval functions.

Rather than doing that kind of dance, we should offer a per object flag to control that behavior (and set it for bson passed between js threads).

We should also remove the scrubbing that occurs in _threadStartWrapper()



 Comments   
Comment by Gregory McKeon (Inactive) [ 25/Jan/19 ]

Sending to dev tools to see if this is is covered by gabriel.russell's js work.

Generated at Thu Feb 08 04:43:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.