Skip to content

Commit b083b6a

Browse files
committed
fix: don't allow to create record in any resource
AdminForth/1731/security-audit
1 parent 0762f40 commit b083b6a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export default class InlineCreatePlugin extends AdminForthPlugin {
6969
handler: async ({ body, adminUser }) => {
7070
const { record, resourceId } = body;
7171

72+
if ( this.resourceConfig.resourceId !== resourceId) {
73+
return { error: 'Resource ID mismatch' };
74+
}
7275
const resource = this.adminforth.config.resources.find(r => r.resourceId === resourceId);
7376

7477
const cleanRecord = resource.columns.reduce((acc, field) => {

0 commit comments

Comments
 (0)