@@ -10,11 +10,12 @@ import { TableActionMethodEnum } from '../../../enums/table-action-method-enum.j
1010import { ConnectionNotFoundException } from '../../../exceptions/custom-exceptions/connection-not-found-exception.js' ;
1111import { Messages } from '../../../exceptions/text/messages.js' ;
1212import { isSaaS } from '../../../helpers/app/is-saas.js' ;
13+ import { Constants } from '../../../helpers/constants/constants.js' ;
1314import { Encryptor } from '../../../helpers/encryption/encryptor.js' ;
1415import { actionSlackPostMessage } from '../../../helpers/slack/action-slack-post-message.js' ;
16+ import { slackPostMessage } from '../../../helpers/slack/slack-post-message.js' ;
1517import { isObjectPropertyExists } from '../../../helpers/validators/is-object-property-exists-validator.js' ;
16- // TODO: temporarily disabled SSRF/URL safety check in activateTableAction. Restore import to re-enable.
17- // import { getSsrfSafeRequestConfig } from '../../../helpers/validators/ssrf-safe-http.js';
18+ import { getSsrfSafeRequestConfig } from '../../../helpers/validators/ssrf-safe-http.js' ;
1819import { ConnectionEntity } from '../../connection/connection.entity.js' ;
1920import { EmailService } from '../../email/email/email.service.js' ;
2021import { escapeHtml } from '../../email/utils/escape-html.util.js' ;
@@ -212,9 +213,7 @@ export class TableActionActivationService {
212213 let result : AxiosResponse < any , any > | undefined ;
213214 try {
214215 result = await axios . post ( tableAction . url , actionRequestBody , {
215- // TODO: SSRF/URL safety check temporarily disabled. Restore the line below to re-enable.
216- // ...getSsrfSafeRequestConfig(),
217- timeout : 10_000 ,
216+ ...getSsrfSafeRequestConfig ( ) ,
218217 headers : { 'Rocketadmin-Signature' : autoadminSignatureHeader , 'Content-Type' : 'application/json' } ,
219218 maxRedirects : 0 ,
220219 validateStatus : ( status ) => status <= 599 ,
@@ -225,6 +224,23 @@ export class TableActionActivationService {
225224 console . info ( 'HTTP action result headers' , result ?. headers ) ;
226225 }
227226 } catch ( error ) {
227+ // TODO: temporary diagnostics for the SSRF safety check. A URL blocked by the guard surfaces
228+ // here as a request failure carrying the "SSRF guard" message. Report those to the errors
229+ // channel so we can confirm the guard is not rejecting legitimate action URLs, then remove.
230+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
231+ if ( errorMessage . includes ( 'SSRF guard' ) ) {
232+ const host = ( ( ) => {
233+ try {
234+ return new URL ( tableAction . url ) . host ;
235+ } catch {
236+ return tableAction . url ;
237+ }
238+ } ) ( ) ;
239+ slackPostMessage (
240+ `[ssrf-check] Table action URL validation failed for host "${ host } ": ${ errorMessage } ` ,
241+ Constants . EXCEPTIONS_CHANNELS ,
242+ ) . catch ( ( ) => undefined ) ;
243+ }
228244 if ( axios . isAxiosError ( error ) ) {
229245 const errorMessage =
230246 result ?. data ?. error ||
0 commit comments