Skip to content

F/os 303 digital signature security - #385

Open
stankut wants to merge 5 commits into
developfrom
f/OS-303_digital_signature_security
Open

stankut wants to merge 5 commits into
developfrom
f/OS-303_digital_signature_security

Conversation

@stankut

@stankut stankut commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

…_digital_signature_security

* commit '100e15f20d3d26f5d9950134282b74bea48aa960': (42 commits)
  312: Set #parents before building handler configuration forms
  Computed twig  encryption fix (#380)
  #321 deleting SaveToFile handler (#382)
  Fixing autocomplete fields usage (#381)
  Add missing trailing comma
  Applied map display settings consistently
  Remove delete state from handlers and require php 8.3
  Preparing 6.1.0
  Bumped os2web_datalookup version
  Apply coding standards
  Ensure no attachments with export type html are signed
  Run handler conditions before adding signature validation text
  Upgrading Gin theme
  OS-320 SBSYS child elements integration (#365)
  Fixing translation setting page (#359)
  Synching develop with master changes (#364)
  Preparing release 6.0.0
  #355 OS-314 children select element '#address_protection_help_text' fix
  352: Code cleanup
  352: Updated CHANGELOG
  ...

# Conflicts:
#	modules/os2forms_digital_signature/src/Plugin/WebformHandler/DigitalSignatureWebformHandler.php
@ds-bellcom

Copy link
Copy Markdown
Contributor

@MadNicGit vil I lave review på dette PR. Det er ikke et issue på dette PR af sikkerhedsmæssige årsager. Spørg evt. Gitte efter en mail jeg lige har sendt til Koordinationsgruppen.

$expectedFileUri = $file->getFileUri();
// If $existingAttachment FID is present - we are replacing uploaded/managed
// file, otherwise, creating a new one.
$existingAttachment = $this->signingDocumentResolver->resolve($webformSubmission);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be beneficial to resolve this as early as possible? Say, before downloading the signed file's content but after checking the hashes?


/** @var \Drupal\webform\Plugin\WebformElementAttachmentInterface $elementPlugin */
$elementPlugin = $this->elementManager->getElementInstance($element);
$attachments = $elementPlugin->getEmailAttachments($element, $webformSubmission);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am i right in saying that the resolve method is used in preSave() to render and get the actual content of the attachment file?

But then it is also used during signCallback() just for the purpose of finding the fid? Is it not possible to use a more light-weight method of finding the fid?

Comment on lines +86 to +91
// SwiftMailer and Mime Mail consume filecontent rather than filepath.
if (($this->moduleHandler->moduleExists('swiftmailer')
|| $this->moduleHandler->moduleExists('mimemail'))
&& isset($attachment['filecontent'], $attachment['filepath'])) {
unset($attachment['filepath']);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use either of these modules. Do you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants