mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Restrict read/write file paths access (#6582)
This commit is contained in:
@@ -67,15 +67,17 @@ export class ReadBinaryFile implements INodeType {
|
||||
}
|
||||
|
||||
const filePath = this.getNodeParameter('filePath', itemIndex);
|
||||
|
||||
const stream = await this.helpers.createReadStream(filePath);
|
||||
const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
newItem.binary![dataPropertyName] = await this.helpers.prepareBinaryData(stream, filePath);
|
||||
returnData.push(newItem);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({
|
||||
json: {
|
||||
error: error.message,
|
||||
error: (error as Error).message,
|
||||
},
|
||||
pairedItem: {
|
||||
item: itemIndex,
|
||||
|
||||
Reference in New Issue
Block a user