-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improvement(rce): updated rce to use isolate pkg for RCE #2385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile SummaryThis PR replaces the Node.js Key Changes:
Security Improvements:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant Route as POST /api/function/execute
participant IsolatedVM as executeInIsolatedVM
participant Isolate as V8 Isolate
participant SecureFetch as secureFetch
Client->>Route: POST { code, params, envVars, ... }
Route->>Route: Resolve variables in code
Route->>IsolatedVM: Execute code request
IsolatedVM->>Isolate: Create V8 Isolate (128MB limit)
IsolatedVM->>Isolate: Create context
IsolatedVM->>Isolate: Set up globals (params, envVars, console)
IsolatedVM->>Isolate: Set up __fetchRef callback
IsolatedVM->>Isolate: Run bootstrap (console, fetch, block globals)
IsolatedVM->>Isolate: Compile and run user code
alt User code calls fetch
Isolate->>SecureFetch: __fetchRef.apply(url, options)
SecureFetch->>SecureFetch: validateProxyUrl (SSRF check)
SecureFetch-->>Isolate: JSON response
end
alt Success
Isolate-->>IsolatedVM: JSON result
IsolatedVM-->>Route: { result, stdout }
Route-->>Client: 200 { success: true, output }
else Error
Isolate-->>IsolatedVM: Error info
IsolatedVM-->>Route: { error, stdout }
Route->>Route: Format enhanced error
Route-->>Client: 500 { success: false, error }
end
IsolatedVM->>Isolate: dispose()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, no comments
Summary
Type of Change
Testing
Tested manually
Checklist