Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix(media): read media through the SSRF-safe axios client

Gilad Resisia2794ab655c0
diff --git a/libraries/nestjs-libraries/src/integrations/social.abstract.ts b/libraries/nestjs-libraries/src/integrations/social.abstract.ts
index df0eef353..5cb72a733 100644
--- a/libraries/nestjs-libraries/src/integrations/social.abstract.ts
+++ b/libraries/nestjs-libraries/src/integrations/social.abstract.ts
@@ -10,7 +10,6 @@ import {
getSsrfSafeAxios,
getSsrfSafeDispatcher,
} from '@gitroom/nestjs-libraries/dtos/webhooks/ssrf.safe.dispatcher';
-import axios from 'axios';
import sharp from 'sharp';
import { createReadStream, readFileSync, statSync } from 'fs';
import { Readable } from 'stream';
@@ -277,7 +276,9 @@ export abstract class SocialAbstract {
try {
return (
- await axios({
+ // the media path is user-influenced, so it goes through the same
+ // SSRF-safe client as every other outbound media read
+ await this.getSsrfSafeAxios()({
url: path,
method: 'GET',
responseType: 'arraybuffer',