set strict source (#185)

* set strict source

RTPBleed

* change to env var for strict source

* Update srtp-transcoding.json

* lint

* lint

* reverse the logic

* and argghhh

* clarification

* change
This commit is contained in:
Sam Machin
2025-08-04 00:44:31 +01:00
committed by GitHub
parent 6771cbdefc
commit 9357920f76
3 changed files with 9 additions and 3 deletions

View File

@@ -3,6 +3,6 @@
"DTLS": "off",
"SDES": "off",
"ICE": "remove",
"flags": ["media handover", "port latching"],
"flags": ["port latching"],
"rtcp-mux": ["demux"]
}

View File

@@ -3,13 +3,13 @@
"transport-protocol": "UDP/TLS/RTP/SAVPF",
"ICE": "force",
"SDES": "off",
"flags": ["generate mid", "SDES-no", "media handover", "port latching"],
"flags": ["generate mid", "SDES-no", "port latching"],
"rtcp-mux": ["require"]
},
"teams": {
"transport-protocol": "RTP/SAVP",
"ICE": "force",
"flags": ["generate mid", "media handover",
"flags": ["generate mid",
"SDES-no-AES_CM_128_HMAC_SHA1_32",
"SDES-no-F8_128_HMAC_SHA1_80",
"SDES-no-F8_128_HMAC_SHA1_32",

View File

@@ -28,6 +28,12 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, padCrypto, teams
srcOpts.flags.push('inject DTMF');
}
}
/** By default use strict source to secure aganst RTPInject vuln,
* set env var to true to disable it and use media handover instead */
const disableStrictSource = !!process.env.RTPENGINE_DISABLE_STRICT_SOURCE;
dstOpts.flags.push(disableStrictSource ? 'media handover' : 'strict source');
srcOpts.flags.push(disableStrictSource ? 'media handover' : 'strict source');
const common = {
'call-id': req.get('Call-ID'),
'replace': ['origin', 'session-connection'],