You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "raboof (via GitHub)" <gi...@apache.org> on 2025/02/07 16:46:24 UTC
[PR] Describe the security model [commons-configuration]
raboof opened a new pull request, #540:
URL: https://github.com/apache/commons-configuration/pull/540
For 2.x we intend not to allow code execution or DoS issues when loading and processing untrusted configurations.
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Thanks for your contribution to [Apache Commons](https://commons.apache.org/)! Your help is appreciated!
Before you push a pull request, review this list:
- [x] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
- [x] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself.
- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2645015937
> > For 2.x we intend not to allow code execution or DoS issues when loading and processing untrusted configurations.
>
> Is it possible? Commons Configuration has features like loading classes by name and JNDI lookups. I don't see how we can prevent code execution on untrusted configurations.
Specifying the security model is a great opportunity to make this clear :).
Indeed loading configurations from untrusted locations with `JNDIConfiguration` would likely be unsafe, just like loading untrusted configuration definitions/declarations. Assuming those are trusted the configuration files 'themselves' should not allow triggering arbitrary code execution or DoS, though, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #540:
URL: https://github.com/apache/commons-configuration/pull/540
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2646141665
> > For Commons Configuration 2.x, loading untrusted configuration files or performing operations
> > on them should not allow code execution, and should not cause any denial of service situations.
>
> What I understand here is that even if you allow external users to supply configuration files and you process them through Commons Configuration, no DoS or code execution will be triggered.
Yes, that was my assumption - I could of course very well be wrong about that, I'm by no means a Commons Configuration expert.
> This is IMHO impossible to guarantee and we will have to publish CVEs like the recent one in Logback: [CVE-2024-12798](https://www.cve.org/CVERecord?id=CVE-2024-12798).
AFAICT we *do* publish CVEs like that for Commons Configuration (e.g. https://www.cve.org/CVERecord?id=CVE-2022-33980 ). Are you aware of any places where Commons Configuration allows triggering code execution or DoS 'by design'?
FWIW: I don't have a strong opinion on whether we 'should' consider configuration trusted or allow untrusted input - we should just clearly document the expectations ;) .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2643821147
> > For 2.x we intend not to allow code execution or DoS issues when loading and processing untrusted configurations.
>
> Is it possible? Commons Configuration has features like loading classes by name and JNDI lookups. I don't see how we can prevent code execution on untrusted configurations.
I'll adjust the wording.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2648423932
> Related to the above: the phrase "should not" is ambiguous. It can mean: "is not expected to" or "is not intended to" (and probably other subtleties)
follow-up in #541
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2646115589
> Indeed loading configurations from untrusted locations with `JNDIConfiguration` would likely be unsafe, just like loading untrusted configuration definitions/declarations. Assuming those are trusted the configuration files 'themselves' should not allow triggering arbitrary code execution or DoS, though, right?
Yes, but that is not what I understand, when reading:
> For Commons Configuration 2.x, loading untrusted configuration files or performing operations
> on them should not allow code execution, and should not cause any denial of service situations.
What I understand here is that even if you allow external users to supply configuration files and you process them through Commons Configuration, no DoS or code execution will be triggered.
This is IMHO impossible to guarantee and we will have to publish CVEs like the recent one in Logback: [CVE-2024-12798](https://www.cve.org/CVERecord?id=CVE-2024-12798).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2646146196
Related to the above: the phrase "should not" is ambiguous.
It can mean: "is not expected to" or "is not intended to" (and probably other subtleties)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2646148686
> Related to the above: the phrase "should not" is ambiguous. It can mean: "is not expected to" or "is not intended to" (and probably other subtleties)
I meant both; that it is not intended and also not expected to. We 'should' definitely improve the wording :).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2643749454
> For 2.x we intend not to allow code execution or DoS issues when loading and processing untrusted configurations.
Is it possible? Commons Configuration has features like loading classes by name and JNDI lookups. I don't see how we can prevent code execution on untrusted configurations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Describe the security model [commons-configuration]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #540:
URL: https://github.com/apache/commons-configuration/pull/540#issuecomment-2646164846
> > What I understand here is that even if you allow external users to supply configuration files and you process them through Commons Configuration, no DoS or code execution will be triggered.
>
> Yes, that was my assumption - I could of course very well be wrong about that, I'm by no means a Commons Configuration expert.
I am not an expert either. My remarks are mostly based on the difficulty to parse untrusted configuration files in a secure way. Parsing simple key/value configuration files should be safe, but features like [customizable entity resolver](https://commons.apache.org/proper/commons-configuration/userguide/howto_xml.html#Default_Entity_Resolution), [expression engines](https://commons.apache.org/proper/commons-configuration/userguide/howto_hierarchical.html#Expression_engines) or [declaring and creating beans](https://commons.apache.org/proper/commons-configuration/userguide/howto_beans.html#Declaring_and_Creating_Beans) are _à priori_ dangerous.
> > This is IMHO impossible to guarantee and we will have to publish CVEs like the recent one in Logback: [CVE-2024-12798](https://www.cve.org/CVERecord?id=CVE-2024-12798).
>
> AFAICT we _do_ publish CVEs like that for Commons Configuration (e.g. https://www.cve.org/CVERecord?id=CVE-2022-33980 ). Are you aware of any places where Commons Configuration allows triggering code execution or DoS 'by design'?
I think I am understanding better the problem now. We want to guarantee that "by default" Commons Configuration is safe for parsing untrusted data, but if users enable some features like the `script` lookup or use `BeanHelper`, they need to restrict themselves to **trusted** data and duly document this fact.
Maybe we should list the sensitive features in the security models, so we don't receive reports like "if an attacker has access to the configuration file and `BeanHelper` is used, he can instantiate **any** Java class (including `MLet` and similar).
> FWIW: I don't have a strong opinion on whether we 'should' consider configuration trusted or allow untrusted input - we should just clearly document the expectations ;) .
I don't have a strong opinion either.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org