-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(rce): updated rce to use isolate pkg for RCE #2382
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 SummaryMigrated JavaScript code execution from Node.js Key Changes
Security Improvements
Issues Found
Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant API as Function Execute API
participant IVM as Isolated VM
participant Security as Security Validation
participant Host as Host Environment
Client->>API: POST /api/function/execute
Note over API: Extract code, params, envVars
alt E2B Enabled & Python
API->>Host: executeInE2B()
Host-->>API: E2B Result
else JavaScript Execution
API->>IVM: executeInIsolatedVM(request)
Note over IVM: Create new V8 Isolate<br/>(memoryLimit: 128MB)
IVM->>IVM: Initialize context & jail
IVM->>IVM: Set up console callbacks
IVM->>IVM: Set up secure fetch wrapper
Note over IVM: Bootstrap sandbox:<br/>- Define console object<br/>- Define fetch function<br/>- Undefine dangerous globals
IVM->>IVM: Inject params & envVars
IVM->>IVM: Compile & run user code
alt User code calls fetch
IVM->>Security: validateProxyUrl(url)
Security-->>IVM: Validation result
alt URL is valid
IVM->>Host: fetch(url, options)
Host-->>IVM: Response
else SSRF detected
IVM-->>IVM: Throw Security Error
end
end
alt Execution success
IVM-->>API: {result, stdout}
else Execution error
IVM-->>API: {error, stdout}
end
IVM->>IVM: Dispose isolate
end
API-->>Client: JSON response
|
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, 5 comments
df985d4 to
bcf8382
Compare
a6a02f1 to
3749fe1
Compare
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.
10 files reviewed, 5 comments
b5e023f to
51132c9
Compare
Summary
Type of Change
Testing
Tested manually
Checklist