Incorrect request type in oracle currency pairs query whitelist breaks price discovery
The query whitelist for the oracle's GetAllCurrencyPairs endpoint incorrectly used the response type as the request type, causing a deserialisation error when clients tried to query supported currency pairs. This prevented clients from discovering which currency pairs are available, breaking price discovery and market data initialisation.
Submitted by Rhaydden
In keepers.go, the GetAllCurrencyPairs query endpoint is misconfigured with an incorrect request type:
The root cause is that the request type is incorrectly set to GetAllCurrencyPairsResponse when it should be GetAllCurrencyPairsRequest. This mismatch between the expected and actual request types causes a protocol buffer deserialization error when clients attempt to query the supported currency pairs.
The GetAllCurrencyPairs endpoint is used during market data initialization and price oracle operations. Looking at the imports and genesis setup, we can see that this is part of the Skip Protocol’s oracle system (from github.com/skip-mev/connect/v2/x/oracle/types).
A specific use case that would be broken by this bug is the initialization of market data during genesis, as seen in the AddMarketData function in genesis.go. The oracle genesis state is configured here, and the currency pairs are essential for setting up initial price feeds for trading pairs; configuring which currency pairs can be queried for prices and establishing the baseline for the auction module’s pricing functionality.
This would prevent any client (including the app itself) from querying the list of supported currency pairs; which is critical for validators who need to know which pairs they should be providing price data for, trading interfaces that need to display available trading pairs and the auction module which needs to verify valid currency pairs for pricing assets.
This is particularly impactful because while individual price queries (via /connect.oracle.v2.Query/GetPrice) would still work, the ability to discover what pairs are actually supported is completely broken; making it impossible to programmatically determine which pairs are valid without hardcoding them.
Proof of concept
Issue is in the query whitelist configuration in app/keepers/keepers.go:
File: app/keepers/keepers.go
550: queryWhitelist.Stargate["/connect.oracle.v2.Query/GetAllCurrencyPairs"] = movetypes.ProtoSet{
551: Request: &oracletypes.GetAllCurrencyPairsResponse{}, <-------
552: Response: &oracletypes.GetAllCurrencyPairsResponse{},
553: }
The genesis state initialization in app/genesis.go that depends on this functionality:
File: app/genesis.go
49: func (genState GenesisState) AddMarketData(cdc codec.JSONCodec, ac address.Codec) GenesisState {
50: var oracleGenState oracletypes.GenesisState
51: cdc.MustUnmarshalJSON(genState[oracletypes.ModuleName], &oracleGenState)
52: // ... market data initialization depending on currency pairs
When clients attempt to query /connect.oracle.v2.Query/GetAllCurrencyPairs, the request will fail because:
- The client sends a
GetAllCurrencyPairsRequestmessage. - The system attempts to deserialize this into a
GetAllCurrencyPairsResponsetype. - The deserialization fails due to message type mismatch.
Recommended mitigation steps
Correct the request type in the query whitelist configuration:
queryWhitelist.Stargate["/connect.oracle.v2.Query/GetAllCurrencyPairs"] = movetypes.ProtoSet{
- Request: &oracletypes.GetAllCurrencyPairsResponse{},
+ Request: &oracletypes.GetAllCurrencyPairsRequest{},
Response: &oracletypes.GetAllCurrencyPairsResponse{},
}
Revision here.
beer-1 (Initia) confirmed, but disagreed with severity and commented:
Good to lower the severity to low.
@beer-1 - I view this as a a valid medium:
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
This does present to me as an unavailable function of the protocol that is expected to work and important to the workflow of integrators. Please feel free to elaborate as to why you view it as low risk.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The endpoint becomes unavailable, preventing clients from discovering supported currency pairs, which could impact validators, trading interfaces, and the auction module.
What the attacker needed
None
The fix
The request type in the query whitelist configuration should be corrected to GetAllCurrencyPairsRequest.
How it was found
- A client sends a GetAllCurrencyPairsRequest message to the endpoint.
- The system attempts to deserialise this into a GetAllCurrencyPairsResponse type.
- The deserialisation fails due to message type mismatch.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A whitelist is a list of allowed requests. Here, the code that checks incoming requests expected the wrong kind of message, so every legitimate request to list currency pairs failed. This meant users and the app itself could not find out which trading pairs were supported.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.