TheWebMachine Networks Support Wiki

The Home of AWS FreePBX® - A division of Rebar IT Outsourcing

Site Tools


aws_freepbx:security_advisories:ghsa_rxx2_w276_rg8q

OAuth Key Rotation Guide - GHSA-rxx2-w276-rg8q - PUBLIC DISCLOSURE DATE: 2026-12-10 (PENDING)

Overview

This guide provides detailed instructions for rotating OAuth private keys on AWS FreePBX installations affected by security advisory GHSA-rxx2-w276-rg8q.

Background

What Happened?

An error in the image preparation process left default API OAuth private keys in packaged Amazon Machine Images (AMI) for AWS Marketplace versions 17.5 and earlier. This means that instances of AWS FreePBX launched from these AMIs may have shared OAuth private keys regardless of whether you are currently utilizing GraphQL and other API services on those instances.

Affected Versions

  • Affected: AWS FreePBX AMI v17.5 and earlier, and all instances launched from those versions
  • Unaffected: Instances launched from AMI v17.6 or later generates unique keys on instance launch

Compromised Key Fingerprints (sha256sum)

7068ba24500a7ab654bd800b7fd071a39ce4afa10b2dc8d7a0f6d509334ff36b  api_oauth.key
7c5818cff96cee55dc374f7187b868812c25030e9eb107ed1ee0b7159d1a2703  api_oauth_public.key

Risk Assessment

  • CWE: CWE-321 (Improper Destruction of Sensitive Information)
  • CVSS 3.1: Not officially assigned
  • Risk Level: Low to Medium

Who Should Rotate Keys?

All users who launched their instances from AMI v17.5 or earlier need to rotate their keys.

Urgency Depends on Use

While all users should rotate their keys, the urgency varies based on whether you ever generated and utilized API tokens:

  • If you have never used the API: You can wait until your convenience to perform rotation
  • If you have used API tokens: You should prioritize immediate rotation

OAuth Key Rotation Procedures

Method 1: SmartUpgrade Automatic Prompt

SmartUpgrade will warn and prompt you to generate a new set of keys during every update run until the keys are rotated. You need to explicitly allow the rotation when prompted. The prompt has a 30s automatic timeout, skipping the rotation.

Steps:

1. Schedule a maintenance window and create a Machine Image backup of your Instance - Rotating keys will invalidate existing tokens immediately

2. Run a normal SmartUpgrade routine via:

smartupgrade --auto

3. Respond to the prompt when SmartUpgrade asks about rotating OAuth keys

4. Wait for completion and verify success message

5. Generate new tokens for all existing API connections and distribute to your other applications, if applicable

Important Notes:

  • SmartUpgrade will warn you but will NOT automatically rotate on existing instances
  • You must explicitly allow the rotation during the update process


Method 2: Manual Command Execution

If SmartUpgrade did not prompt you, or if you prefer manual control, you can rotate OAuth keys at any time:

Steps:

1. Schedule a maintenance window and create a Machine Image backup of your Instance - Rotating keys will invalidate existing tokens immediately

2. Run the key rotation command via SSH:

smartupgrade rotate-oauth-keys

3. Follow prompts to confirm key rotation

4. Generate new tokens if you already had tokens generated for your API applications, if applicable

Generating New Tokens

After rotating keys, you MUST generate new OAuth tokens for all existing API connections and redistribute/reconfigure your other external services with the newly generated tokens.

Technical Details

Proof of Concept Summary

Two independent EC2 instances launched with fresh root disks from AWS Marketplace AMI v17.5 started with identical `/etc/asterisk/keys/api_oauth.key` signing keys. This was established using local SHA-256 fingerprints.

Cross-Instance Authorization Demonstration

The PoC showed that:

  1. Two AMI instances from the same image shared identical OAuth signing keys
  2. A valid target token with narrow scope from instance A could be re-signed with the same key on instance B to gain additional scopes
  3. However, this required both the shared key AND a still-valid target token ID

Acknowledgements

This advisory is a result of a vulnerability disclosure by a Security Researcher and coordinated with the help of the Sangoma Security Team. Many thanks to the individual who responsibly reported this issue!

aws_freepbx/security_advisories/ghsa_rxx2_w276_rg8q.txt · Last modified: by TheWebMachine Networks