### Description
Our partner sending a call with this header
```
From: "COVER JERRY & M" <sip:+12099283442@206.147.236.174:5060;otg=TLMNCAXFDS0_3887>;tag=gK0c7f90e2
```
According [RFC3261](https://www.rfc-editor.org/rfc/rfc3261#section-25.1)
```
Several rules are incorporated from RFC 2396 [5] but are updated to
make them compliant with RFC 2234 [10]. These include:
reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
/ "$" / ","
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" / "'"
/ "(" / ")"
escaped = "%" HEXDIG HEXDIG
```
Also
```
SIP follows the requirements and guidelines of RFC 2396 [5] when
defining the set of characters that must be escaped in a SIP URI, and
uses its ""%" HEX HEX" mechanism for escaping. From RFC 2396 [5]:
The set of characters actually reserved within any given URI
component is defined by that component. In general, a character
is reserved if the semantics of the URI changes if the character
is replaced with its escaped US-ASCII encoding [5]. Excluded US-
ASCII characters (RFC 2396 [5]), such as space and control
characters and characters used as URI delimiters, also MUST be
escaped. URIs MUST NOT contain unescaped space and control
characters.
```
And
```
Expanding the hname and hvalue tokens in Section 25 show that all URI
reserved characters in header field names and values MUST be escaped.
```
For now, looks like `the sanity` module does not check reserver char usage.
This ticket was created to collect recommendations for feature implementation.
Should be checked headers?
Maybe a similar check is already present in the code and you can provide a reference?
Unscaped reserved char usage in "From", "To", "P-Asserted-Identity" and "Remote-Party-ID" for display name breaking SIP message (for example the "lost" module cannot parse properly "From" header). Should such be implemented in the Kamailio core also?
### Expected behavior
One of these expected:
1) Kamailio drop a message with reserved char usage in the header names and values. For TCP and TLS transport drop connection;
2) sanity module allows checking reserved char usage in the header names and values.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3421
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3421(a)github.com>
Module: kamailio
Branch: master
Commit: 4c8276fcf268a690ea671c4ddeaad1f89e293565
URL: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
kex: typos
---
Modified: src/modules/kex/core_stats.c
Modified: src/modules/kex/doc/kex_admin.xml
Modified: src/modules/kex/kex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
Patch: https://github.com/kamailio/kamailio/commit/4c8276fcf268a690ea671c4ddeaad1f…
---
diff --git a/src/modules/kex/core_stats.c b/src/modules/kex/core_stats.c
index 565ce4e77d7..816ae39a90f 100644
--- a/src/modules/kex/core_stats.c
+++ b/src/modules/kex/core_stats.c
@@ -409,7 +409,7 @@ struct rpc_list_params {
/**
- * Satistic getter RPC callback.
+ * Statistic getter RPC callback.
*/
static void rpc_get_grp_vars_cbk(void* p, str* g, str* n, counter_handle_t h)
{
@@ -644,7 +644,7 @@ static void rpc_stats_fetchn_statistics(rpc_t* rpc, void* ctx)
}
/**
- * Satistic reset/clear-er RPC callback..
+ * Statistic reset/clear-er RPC callback..
*/
static void rpc_reset_or_clear_grp_vars_cbk(void* p, str* g, str* n,
counter_handle_t h)
diff --git a/src/modules/kex/doc/kex_admin.xml b/src/modules/kex/doc/kex_admin.xml
index 34484bc4ec8..5c597e97047 100644
--- a/src/modules/kex/doc/kex_admin.xml
+++ b/src/modules/kex/doc/kex_admin.xml
@@ -88,7 +88,7 @@ setsflag("$var(flag)");
<section id="kex.f.issflagset">
<title><function moreinfo="none">issflagset(flag)</function></title>
<para>
- Return true of the script flag is set.
+ Return true if the script flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -179,7 +179,7 @@ setbflag("$var(flag)", "1");
<section id="kex.f.isbflagset">
<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
<para>
- Return true of the branch flag is set.
+ Return true if the branch flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
@@ -762,7 +762,7 @@ resetdebug();
</title>
<para>Print the list of available internal statistics.</para>
<para>NOTE: the result is an array of strings that have the list of
- statistics formated like "name = value", being propagated over the time
+ statistics formatted like "name = value", being propagated over the time
from the MI variant. Use "stats.fetch" or "stats.fetchn"commands to have
a more JSON-friendly output.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
@@ -785,7 +785,7 @@ resetdebug();
<para>Print the list of available internal statistics with a more
json friendly output. Each printed statistic is a field in the output
structure: {"statsgroup.statsname" : "statsvalue"}. The value is
- represented as string to accomodate large numbers.</para>
+ represented as string to accommodate large numbers.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be printed. If set to 'all' then all statistics are printed; if
set to 'statsgroup:' then all statistics in the group are printed;
diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index e46e85b5cf4..1927c7343d3 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -141,7 +141,7 @@ static int mod_init(void)
register_pkg_proc_stats();
pkg_proc_stats_init_rpc();
- /* per module memmory debugging RPC command */
+ /* per module memory debugging RPC command */
mod_stats_init_rpc();
return 0;
Module: kamailio
Branch: master
Commit: 8c5a8ce562e5ab98a7e6bdf163bab833ec3a7cf5
URL: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
jwt: typo algoritm ������ algorithm
---
Modified: src/modules/jwt/doc/jwt_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
Patch: https://github.com/kamailio/kamailio/commit/8c5a8ce562e5ab98a7e6bdf163bab83…
---
diff --git a/src/modules/jwt/doc/jwt_admin.xml b/src/modules/jwt/doc/jwt_admin.xml
index 165ca170f95..5389bb61f30 100644
--- a/src/modules/jwt/doc/jwt_admin.xml
+++ b/src/modules/jwt/doc/jwt_admin.xml
@@ -101,7 +101,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>
@@ -158,7 +158,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>
@@ -210,7 +210,7 @@ modparam("jwt", "key_mode", 1)
</listitem>
<listitem>
<para>
- alg - the algoritm to build the signature, as supported by the
+ alg - the algorithm to build the signature, as supported by the
libjwt (e.g., RS256, HS256, ES256, ...)
</para>
</listitem>
Module: kamailio
Branch: master
Commit: 285a260687d4dce5636531a4ffffc43b0d37e883
URL: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
jsonrpcs: typos
---
Modified: src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
Modified: src/modules/jsonrpcs/jsonrpcs_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
Patch: https://github.com/kamailio/kamailio/commit/285a260687d4dce5636531a4ffffc43…
---
diff --git a/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml b/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
index 9e558c4cfd..0e39676edd 100644
--- a/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
+++ b/src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
@@ -380,7 +380,7 @@ modparam("jsonrpcs", "dgram_user", "root")
<section id="jsonrpcs.p.dgram_timeout">
<title><varname>dgram_timeout</varname> (int)</title>
<para>
- The reply will expire after trying to sent it for socket_timeout
+ The reply will expire after trying to send it for socket_timeout
milliseconds.
</para>
<para>
diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c b/src/modules/jsonrpcs/jsonrpcs_mod.c
index e369c62569..8ce008ccb5 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -298,7 +298,7 @@ static int jsonrpc_delayed_reply_ctx_init(jsonrpc_ctx_t* ctx)
/** Implementation of rpc_fault function required by the management API.
*
* This function will be called whenever a management function
- * indicates that an error ocurred while it was processing the request. The
+ * indicates that an error occurred while it was processing the request. The
* function takes the reply code and reason phrase as parameters, these will
* be put in the body of the reply.
*
@@ -340,7 +340,7 @@ static void jsonrpc_fault(jsonrpc_ctx_t* ctx, int code, char* fmt, ...)
* This is the function that will be called whenever a management function
* asks the management interface to send the reply to the client.
* The SIP/HTTP reply sent to
- * the client will be always 200 OK, if an error ocurred on the server then it
+ * the client will be always 200 OK, if an error occurred on the server then it
* will be indicated in the html document in body.
*
* @param ctx A pointer to the context structure of the jsonrpc request that
@@ -1191,7 +1191,7 @@ static void jsonrpc_delayed_ctx_close(struct rpc_delayed_ctx* dctx)
(hdr->parsed<(void*)r_ctx->msg ||
hdr->parsed>=(void*)(r_ctx->msg+r_ctx->msg_shm_block_size))) {
/* header parsed filed doesn't point inside uas.request memory
- * chunck -> it was added by failure funcs.-> free it as pkg */
+ * chunk -> it was added by failure funcs.-> free it as pkg */
DBG("removing hdr->parsed %d\n", hdr->type);
clean_hdr_field(hdr);
hdr->parsed = 0;
Module: kamailio
Branch: master
Commit: 326ad479fb9e09f4f3a177606f2b5dcc09fbbd62
URL: https://github.com/kamailio/kamailio/commit/326ad479fb9e09f4f3a177606f2b5dc…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-25T22:11:28+02:00
ims_registrar_pcscf: typo
---
Modified: src/modules/ims_registrar_pcscf/save.c
---
Diff: https://github.com/kamailio/kamailio/commit/326ad479fb9e09f4f3a177606f2b5dc…
Patch: https://github.com/kamailio/kamailio/commit/326ad479fb9e09f4f3a177606f2b5dc…
---
diff --git a/src/modules/ims_registrar_pcscf/save.c b/src/modules/ims_registrar_pcscf/save.c
index 88c0c008a8e..db9b7e73877 100644
--- a/src/modules/ims_registrar_pcscf/save.c
+++ b/src/modules/ims_registrar_pcscf/save.c
@@ -254,7 +254,7 @@ static inline int update_contacts(struct sip_msg *req,struct sip_msg *rpl, udoma
}
/**
- * Save contact based on REGISTER request. this will be a pending save, until we receive response
+ * Save contact based on REGISTER request. This will be a pending save, until we receive response
* from SCSCF. If no response after pending_timeout seconds, the contacts is removed. Can only be used from REQUEST ROUTE
*/
int save_pending(struct sip_msg* _m, udomain_t* _d) {