Skip to content

Commit 82f25a5

Browse files
committed
fix security check in BlinkContainer
1 parent b22669a commit 82f25a5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/blinks-core/src/BlinkContainer.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,19 @@ const checkSecurityFromActionState = (
219219
state: ActionStateWithOrigin,
220220
normalizedSecurityLevel: NormalizedSecurityLevel,
221221
): boolean => {
222-
return checkSecurity(state.action, normalizedSecurityLevel.actions) &&
223-
state.origin
224-
? checkSecurity(state.origin, normalizedSecurityLevel[state.originType])
225-
: true;
222+
const checkAction = checkSecurity(
223+
state.action,
224+
normalizedSecurityLevel.actions,
225+
);
226+
227+
if (!state.origin) {
228+
return checkAction;
229+
}
230+
231+
return (
232+
checkAction &&
233+
checkSecurity(state.origin, normalizedSecurityLevel[state.originType])
234+
);
226235
};
227236

228237
const DEFAULT_SECURITY_LEVEL: SecurityLevel = 'only-trusted';

0 commit comments

Comments
 (0)