Security: Sanitize widget api keys from response
Closes https://github.com/gethomepage/homepage/security/advisories/GHSA-cjgf-vhj6-8cx4
This commit is contained in:
1 parent
36e77e1fe3
commit
f0d7cf3ce6
3 files changed
+11
-6
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import cachedFetch from "utils/proxy/cached-fetch";
|
||||
import { getSettings } from "utils/config/config";
|
||||
import { getPrivateWidgetOptions } from "utils/config/widget-helpers";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const { latitude, longitude, units, provider, cache, lang } = req.query;
|
||||
let { apiKey } = req.query;
|
||||
const { latitude, longitude, units, provider, cache, lang, index } = req.query;
|
||||
const privateWidgetOptions = await getPrivateWidgetOptions("openweathermap", index);
|
||||
let { apiKey } = privateWidgetOptions;
|
||||
|
||||
if (!apiKey && !provider) {
|
||||
return res.status(400).json({ error: "Missing API key or provider" });
|
||||
|
||||
Reference in new issue
Block a user