mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-05 20:02:47 +01:00
chore(security): fixes
This commit is contained in:
@@ -45,7 +45,7 @@ export class EncryptNode extends BaseWorkflowNode {
|
||||
return {
|
||||
pdf: await processBatch(pdfInputs, async (input) => {
|
||||
const qpdf = await initializeQpdf();
|
||||
const uid = `${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
||||
const uid = `${Date.now()}_${crypto.randomUUID().slice(0, 7)}`;
|
||||
const inputPath = `/tmp/input_encrypt_${uid}.pdf`;
|
||||
const outputPath = `/tmp/output_encrypt_${uid}.pdf`;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export class LinearizeNode extends BaseWorkflowNode {
|
||||
return {
|
||||
pdf: await processBatch(pdfInputs, async (input) => {
|
||||
const qpdf = await initializeQpdf();
|
||||
const uid = `${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
||||
const uid = `${Date.now()}_${crypto.randomUUID().slice(0, 7)}`;
|
||||
const inputPath = `/tmp/input_linearize_${uid}.pdf`;
|
||||
const outputPath = `/tmp/output_linearize_${uid}.pdf`;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export class OverlayNode extends BaseWorkflowNode {
|
||||
const mode = modeControl?.value === 'underlay' ? '--underlay' : '--overlay';
|
||||
|
||||
const qpdf = await initializeQpdf();
|
||||
const uid = `${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
||||
const uid = `${Date.now()}_${crypto.randomUUID().slice(0, 7)}`;
|
||||
const inputPath = `/tmp/input_overlay_${uid}.pdf`;
|
||||
const overlayPath = `/tmp/overlay_${uid}.pdf`;
|
||||
const outputPath = `/tmp/output_overlay_${uid}.pdf`;
|
||||
|
||||
@@ -25,7 +25,7 @@ export class RepairNode extends BaseWorkflowNode {
|
||||
return {
|
||||
pdf: await processBatch(pdfInputs, async (input) => {
|
||||
const qpdf = await initializeQpdf();
|
||||
const uid = `${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
||||
const uid = `${Date.now()}_${crypto.randomUUID().slice(0, 7)}`;
|
||||
const inputPath = `/tmp/input_repair_${uid}.pdf`;
|
||||
const outputPath = `/tmp/output_repair_${uid}.pdf`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user