Conversation
|
|
|
||
| // Temporarily write JSON to disk for html-reporter | ||
| const tempJsonPath = path.join(process.cwd(), `features/${reportName}.json`); | ||
| await fs.promises.writeFile(tempJsonPath, fullReport.jsonReport); |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
|
|
||
| // Read HTML and send | ||
| const htmlPath = path.join(process.cwd(), `features/${reportName}.html`); | ||
| const htmlContent = await fs.promises.readFile(htmlPath, 'utf8'); |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
| res.json({ htmlFile: htmlContent, reportId: fullReport._id }); // Send HTML content | ||
|
|
||
| // Clean up temporary files | ||
| await fs.promises.unlink(tempJsonPath).catch(err => console.error(`Failed to delete temp JSON: ${err}`)); |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
|
|
||
| // Clean up temporary files | ||
| await fs.promises.unlink(tempJsonPath).catch(err => console.error(`Failed to delete temp JSON: ${err}`)); | ||
| await fs.promises.unlink(htmlPath).catch(err => console.error(`Failed to delete temp HTML: ${err}`)); // Optional: keep HTML? |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
| } catch (error) { | ||
| // Ensure temporary group folder is cleaned up on error if created | ||
| if (req.body?.name && fs.existsSync(path.join(process.cwd(), 'features', req.body.name))) { | ||
| fs.rm(path.join(process.cwd(), 'features', req.body.name), { recursive: true, force: true }, (err) => { |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
| ): Promise<{ success: boolean }> { | ||
| const client = await dbConnector.establishConnection(); | ||
| const session = client.startSession(); | ||
| const zip = new AdmZip(file.buffer); |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High
| const authString = externalAccountService.buildAuthString(jiraAccountName, jiraPassword, jiraAuthMethod); | ||
| const options = { method: 'GET', headers: { 'Authorization': authString }}; | ||
| const jiraURL = `https://${jiraHost}/rest/auth/1/session`; | ||
| const response = await fetch(jiraURL, options); |
Check warning
Code scanning / SonarCloud
Server-side requests should not be vulnerable to forging attacks Medium
| } | ||
| }; | ||
|
|
||
| const response = await fetch(url.toString(), options); |
Check warning
Code scanning / SonarCloud
Server-side requests should not be vulnerable to traversing attacks Medium
|
|
||
| // 3. Send DELETE request to XRay | ||
| console.log(`Sending XRay DELETE request to: ${url}`); | ||
| const response = await fetch(url, options); |
Check warning
Code scanning / SonarCloud
Server-side requests should not be vulnerable to traversing attacks Medium




No description provided.