CVE-2022-4823 (Ruby, published 2022-12-28T21:15Z)
Description: value: A vulnerability, which was classified as problematic, was found in InSTEDD Nuntium. Affected is an unknown function of the file app/controllers/geopoll_controller.rb. The manipulation of the argument signature leads to observable timing discrepancy. It is possible to launch the attack remotely. The name of the patch is 77236f7fd71a0e2eefeea07f9866b069d612cf0d. It is recommended to apply a patch to fix this issue. VDB-217002 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 5.9)
Weakness: CWE-203 \u2014 Observable Discrepancy
The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor, which exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.
Repository: https://github.com/instedd/nuntium
Files changed:
app/controllers/geopoll_controller.rb
app/views/interactions/show.html.erb
Commit message: Detect GeoPoll AT's to: number (#88)

* Securely check GeoPoll incoming signature

This avoids timing attacks

* Log unknown GeoPoll requests parameters

To avoid losing data upon API changes

See #76

* Show GeoPoll channels in Interactions tab

* Detect GeoPoll AT's to: numbers

Fixes #76

Vulnerable code:
  # POST /:account_name/:channel_name/:secret_token/geopoll/incoming
    if signature != params[:Signature]
    msg.to   = "sms://#{channel.configuration[:from]}"
     ao.custom_attributes[:geopoll_status] = status if status
     ao.save!

Fixed code:
  # POST /:account_name/:channel_name/geopoll/incoming
    if !(ActiveSupport::SecurityUtils.secure_compare params[:Signature], signature)
    unknown_params = params.except(
      'Identifier', 'Signature', 'SourceAddress', 'TargetAddress', 'MessageText', # GeoPoll API specification
      'account_name', 'channel_name', 'controller', 'action' # Rails-generated parameters
    )

    msg.to   = "sms://#{params[:TargetAddress]}"
    channel.logger.warning :channel_id => channel.id, :at_message_id => msg.id, :message => "Received unknown parameters for AT #{msg.id}: #{unknown_params.to_json}" unless unknown_params.empty?
    
    unknown_params = params.except(
      'MessageId', 'Status', # GeoPoll API specification
      'account_name', 'channel_name', 'controller', 'action' # Rails-generated parameters
    )

    channel.logger.warning :channel_id => channel.id, :at_message_id => msg.id, :message => "Received unknown parameters for AO #{msg.id} Status: #{unknown_params.to_json}" unless unknown_params.empty?

    ao.custom_attributes[:geopoll_status] = status if status
    ao.save!
  <%- if channels.any?{|c| c.kind == 'geopoll'} -%>
    <div><b>Via <%= link_to 'GeoPoll', 'https://www.geopoll.com/', :target => '_blank' -%></b></div>
    <ul>
      <%- channels.select{|c| c.kind == 'geopoll'}.each do |channel| -%>
        <li>Incoming Messages URL: <span class="url">POST <%= geopoll_incoming_url(:account_name => account.name, :channel_name => channel.name) -%></span>
          create Application Terminated Messages in channel <%= channel.name %></li>
        <li>Delivery Reports Receiver URL: <span class="url">POST <%= geopoll_status_url(:account_name => account.name, :channel_name => channel.name) -%></span>
          receive delivery reports in channel <%= channel.name %></li>
      <%- end -%>
    </ul>
  <%- end -%>