Comments (7)
yea we should try to avoid user-controlled output in error messages.
from micronaut-core.
go ahead :)
from micronaut-core.
After investigation as an immediate workaround I can try to substitute io.micronaut.http.server.exceptions.URISyntaxHandler
. The error itself reported from the guts of JDK java.net.URI.Parser#fail(java.lang.String, int)
from micronaut-core.
@yawkat , what is the recommendation here ?
Option 1 :
Offer a configuration to define whether the exception message should be suppressed or not.
Outcome message is to be suppressed (default) : "message":"Malformed URI"
Outcome message is NOT to be suppressed : "message":"Malformed URI: Illegal character in query at index 2: /?">="
Option 2:
Always suppress the exception message. If someone comes with a requirement that they want the exception to be printed, then implement Option 1.
Outcome : "message":"Malformed URI"
Option 3:
Always encode/escape the content in the exception message before printing to logs. for example < would be encoded as < .
Outcome : "message":"Malformed URI: Illegal character in query at index 2: /?"><tag>="
Option 4:
Offer a configuration to define whether the exception message should be suppressed, encoded or displayed as it is.
Outcome message is to be suppressed : "message":"Malformed URI"
Outcome message is to be encoded (default) : "message":"Malformed URI: Illegal character in query at index 2: /?"><tag>="
Outcome message is NOT to be suppressed : "message":"Malformed URI: Illegal character in query at index 2: /?">="
Personally I prefer Option 4 but Option 2 or Option 1 are also acceptable. What do the maintainers prefer ?
from micronaut-core.
@be-a-bee the path should not be included at all, so option 2. i dont think a config option is necessary. it's also fine if the index is included in the message, but we should avoid the user-supplied input altogether.
from micronaut-core.
Thanks @yawkat for the prompt response. If I may, I will contribute a PR for Option 2.
from micronaut-core.
closed via #10324
from micronaut-core.
Related Issues (20)
- Update to Kotlin 2.0
- Update to Groovy 5.0 HOT 1
- JacksonConfiguration.constructType throws ArrayIndexOutOfBoundsException for an Argument created from ParenthesizedType like Map<String,String> HOT 1
- NoSuchBeanException: No bean of type [io.netty.bootstrap.ServerBootstrap] exists HOT 1
- @Slf4j breaks with cache annotations HOT 2
- @EachProperty with abstract class override + KSP does not compile
- Micronaut mixes up a qualified bean from unqualified one when @Replace is used HOT 4
- Implementing Lazy initialized Bean @Lazy HOT 4
- AnnotationMetadata is empty when we use Optional HOT 2
- Netty DefaultHttpClient logs "BUG - Handler not removed" after adding logbook HOT 1
- Errors On Main Web Site HOT 4
- @Mapper not working for lists
- Rejected auth shouldn't lead to "UnexpectedError" being logged with Error level
- Exception implementing HttpResponseProvider thrown from Controller endpoint shouldn't lead to "Unexpected Error" Error log
- Annotation Processor NPE HOT 7
- @Scheduled does not work with expressions in cron value HOT 3
- ./gradlew buildNativeLambda fails due to logback build time init when using dynamodb feature -> Error: Classes that should be initialized at run time got initialized during image building ->
- Introspection Compilation broken for byte[] types that are constructor arguments
- AWSParameterStoreConfigClient Inconsistence with documentation
- Evaluated expressions not working in all annotations they should be (ex: `io.micrometer.core.annotation.Timed`)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronaut-core.