Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

request and request-promise-native vulnerability #1382

Closed
rygramer opened this issue Aug 8, 2023 · 2 comments
Closed

request and request-promise-native vulnerability #1382

rygramer opened this issue Aug 8, 2023 · 2 comments
Assignees
Labels
dependencies Pull requests that update a dependency file
Milestone

Comments

@rygramer
Copy link

rygramer commented Aug 8, 2023

These two packages are no longer maintained, and Snyk has reported an issue with the request package related to Server-side Request Forgery.

jsforce went through a similar analysis and remediation here: jsforce/jsforce#1312

I wish I could help, but this is out of my wheelhouse. I do think this is an important fix to push through.

"request": "^2.88.2",
"request-promise-native": "^1.0.9",

@github-actions github-actions bot added the analysis To be decided on how to solution/fix label Aug 8, 2023
@rygramer
Copy link
Author

@azlam-abdulsalam I was looking into this a bit more. Looks like the only usage of request / request-promise-native in the entire sfp library is in this method:

public static async getScratchOrgLimits(hubOrg: Org, apiversion: string) {
let conn = hubOrg.getConnection();
let query_uri = `${conn.instanceUrl}/services/data/v${apiversion}/limits`;
const limits = await request({
method: 'get',
url: query_uri,
headers: {
Authorization: `Bearer ${conn.accessToken}`,
},
json: true,
});
SFPLogger.log(`Limits Fetched: ${JSON.stringify(limits)}`, LoggerLevel.TRACE);
return limits;
}

It doesn't look like this method is referenced anywhere in the codebase. (PoolCreateImpl is using ScratchOrgLimitsFetcher, the latter not having a dependency to either request / request-promist native, nor sfprofiles):
this.limits = await new ScratchOrgLimitsFetcher(this.hubOrg).getScratchOrgLimits();

Perhaps the vulnerable method is an artifact of the past, and can simply be removed (which would also eliminate the dependency on request and request-promise-native)?? 🤞

@azlam-abdulsalam
Copy link
Contributor

Wohooo! Thanks @rygramer Checking this one

@azlam-abdulsalam azlam-abdulsalam self-assigned this Aug 14, 2023
@azlam-abdulsalam azlam-abdulsalam added this to the July 23 milestone Aug 14, 2023
@azlam-abdulsalam azlam-abdulsalam added dependencies Pull requests that update a dependency file and removed analysis To be decided on how to solution/fix labels Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants