Security audit fixes for 1.18.0: Markdown negotiation private + Vary: Accept (F3), public lists capped (F4), operator sort names refused (F5), CSP report log normalised and capped (F1), buildUrlField and the reference socials (F2), document locks for staff only
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d2f19095dc
commit
e9f9947eb7
@@ -114,9 +114,8 @@ export const DOORS: Door[] = [
|
||||
{
|
||||
closedFor: ['anonymous'],
|
||||
name: 'who edits what (Payload\'s document locks, with the editor\'s account)',
|
||||
// Payload's own collection: the plugin-wide default for it is the owner's Q3 answer (a), recorded for 2.0; the doctor's
|
||||
// `visitor-writes` rule lists it on a site with a visitor login collection
|
||||
openFor: { callers: ['customer'], question: 'Q3 (a), 2.0: payload-locked-documents runs on Payload\'s default (any signed-in account)' },
|
||||
// Payload's own collection: staff only since 1.18.0 (iapl `lockedDocuments`, the owner's Q3 answer (a)); Payload's
|
||||
// default let any signed-in account in
|
||||
path: '/api/payload-locked-documents',
|
||||
closed: forbidden,
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Container } from '@intecion/ipal-kit/blocks/rsc'
|
||||
import { safeHref } from '@intecion/ipal-kit'
|
||||
import { NoSnippet } from '@intecion/ipal-kit/rsc'
|
||||
import Link from 'next/link'
|
||||
|
||||
@@ -47,11 +48,15 @@ export async function Footer({ company, footer, locale }: Props) {
|
||||
<Link className="hover:text-link-hover" href={link.href}>{link.label}</Link>
|
||||
</li>
|
||||
))}
|
||||
{(company.socials ?? []).map((s) => (
|
||||
<li key={s.url}>
|
||||
<a className="hover:text-link-hover" href={s.url} rel="noopener noreferrer" target="_blank">{s.label}</a>
|
||||
</li>
|
||||
))}
|
||||
{(company.socials ?? []).flatMap((s) => {
|
||||
// the field validates; the render checks again (an import or an older version may hold anything)
|
||||
const href = safeHref(s.url)
|
||||
return href ? [
|
||||
<li key={href}>
|
||||
<a className="hover:text-link-hover" href={href} rel="noopener noreferrer" target="_blank">{s.label}</a>
|
||||
</li>,
|
||||
] : []
|
||||
})}
|
||||
</ul>
|
||||
</Container>
|
||||
</NoSnippet>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GlobalConfig } from 'payload'
|
||||
|
||||
import { adminOrEditor, buildGlobalRevalidateHook, rowLabel } from '@intecion/ipal-kit'
|
||||
import { adminOrEditor, buildGlobalRevalidateHook, buildUrlField, rowLabel } from '@intecion/ipal-kit'
|
||||
import { revalidatePath } from 'next/cache'
|
||||
|
||||
/** Company data for a PL market site: footer, contact block details, LocalBusiness JSON-LD. */
|
||||
@@ -33,7 +33,8 @@ export const Company: GlobalConfig = {
|
||||
labels: { plural: 'Profiles', singular: 'Profile' },
|
||||
fields: [
|
||||
{ name: 'label', type: 'text', required: true },
|
||||
{ name: 'url', type: 'text', required: true },
|
||||
// rendered into href: https:// only, never javascript: or data: (security.md "Addresses rendered into href")
|
||||
buildUrlField({ required: true }),
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { faqItemsFromLayout } from '@intecion/ipal-kit/blocks'
|
||||
// @starter:if localBusiness
|
||||
import { buildLocalBusinessJsonLd, createContentHelpers } from '@intecion/ipal-kit'
|
||||
import { buildLocalBusinessJsonLd, createContentHelpers, isAllowedUrl } from '@intecion/ipal-kit'
|
||||
|
||||
import { contentConfig } from '@/content.config'
|
||||
import { i18nConfig } from '@/i18n.config'
|
||||
@@ -72,7 +72,7 @@ export const {
|
||||
address: { city: company.address?.city ?? undefined, country: company.address?.country ?? 'PL', postalCode: company.address?.postalCode ?? undefined, street: company.address?.street ?? undefined },
|
||||
name: company.name,
|
||||
openingHours: company.hours ?? undefined,
|
||||
sameAs: (company.socials ?? []).map((s) => s.url),
|
||||
sameAs: (company.socials ?? []).map((s) => s.url).filter((url) => isAllowedUrl(url)),
|
||||
telephone: company.phone ?? undefined,
|
||||
type: 'ProfessionalService',
|
||||
url: baseUrl,
|
||||
|
||||
Reference in New Issue
Block a user