[Home]

Summary:ASTERISK-30176: manager: GetConfig can read files outside of Asterisk
Reporter:shawty (shawtyds)Labels:security
Date Opened:2022-08-11 06:55:14Date Closed:2022-12-01 11:47:51.000-0600
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:18.13.0 Frequency of
Occurrence
Related
Issues:
Environment:Linux Ubuntu 20.04 LTS with asterisk built from sourceAttachments:
Description:As per the request made by "jcolp" here : https://community.asterisk.org/t/synchronising-voicemail-folders/93584/32

I've discovered that any config file that follows the same section/key:value format as the config files asterisk uses, can be read given the files system permissions allow it, by the "GetConfig" manager command.

Files not in the same format (such as /etc/passwd) will cause an error, but the method does still try to read them.

I successfully managed to read the samba config file, among others on the dev server I was using for my asterisk work.

I initially found this out, as I was looking for a way to access the TXT files that are used to store Voicemail message info, and found that by specifying the full path to the file I was able to read it.

My curiosity being what it is, I tried this on some non asterisk files and was surprised to see that I could read those too.

This was on a default installation, so no extra steps have been taken to lock down files and configs from other apps running on the same server instance, files do need to have the group & others read ability set, which on a default install is generally every config in /etc and many others.

I have NOT however tested to see if writes work outside of asterisk's files.
Comments:By: Asterisk Team (asteriskteam) 2022-08-11 06:55:41.279-0500

This issue has been automatically restricted and set to a blocker due to being a security type issue. If this is not a security vulnerability issue it will be moved to the appropriate issue type when triaged.

Please DO NOT put a code review up for this change at this time. Attach any applicable patches to this issue.

By: Asterisk Team (asteriskteam) 2022-08-11 06:55:41.359-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Friendly Automation (friendly-automation) 2022-12-01 11:47:51.995-0600

Change 19628 merged by Benjamin Keith Ford:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19628|https://gerrit.asterisk.org/c/asterisk/+/19628]

By: Friendly Automation (friendly-automation) 2022-12-01 11:48:00.966-0600

Change 19629 merged by Benjamin Keith Ford:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19629|https://gerrit.asterisk.org/c/asterisk/+/19629]

By: Friendly Automation (friendly-automation) 2022-12-01 11:48:15.398-0600

Change 19630 merged by Benjamin Keith Ford:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19630|https://gerrit.asterisk.org/c/asterisk/+/19630]

By: Friendly Automation (friendly-automation) 2022-12-01 11:48:26.153-0600

Change 19631 merged by Benjamin Keith Ford:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19631|https://gerrit.asterisk.org/c/asterisk/+/19631]

By: Friendly Automation (friendly-automation) 2022-12-01 11:54:23.012-0600

Change 19646 merged by Benjamin Keith Ford:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19646|https://gerrit.asterisk.org/c/asterisk/+/19646]

By: Friendly Automation (friendly-automation) 2022-12-03 10:22:17.838-0600

Change 19616 merged by Friendly Automation:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19616|https://gerrit.asterisk.org/c/asterisk/+/19616]

By: Friendly Automation (friendly-automation) 2022-12-03 10:22:29.076-0600

Change 19644 merged by Friendly Automation:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19644|https://gerrit.asterisk.org/c/asterisk/+/19644]

By: Friendly Automation (friendly-automation) 2022-12-03 10:23:01.872-0600

Change 19654 merged by Friendly Automation:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19654|https://gerrit.asterisk.org/c/asterisk/+/19654]

By: Friendly Automation (friendly-automation) 2022-12-03 10:23:09.175-0600

Change 19617 merged by Friendly Automation:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19617|https://gerrit.asterisk.org/c/asterisk/+/19617]

By: Friendly Automation (friendly-automation) 2022-12-03 10:29:58.911-0600

Change 19661 merged by Friendly Automation:
manager: prevent file access outside of config dir

[https://gerrit.asterisk.org/c/asterisk/+/19661|https://gerrit.asterisk.org/c/asterisk/+/19661]